hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c8baf82830824db299f13cba47ec97803a15ec78 | 3,087 | py | Python | alectryon/coqc_time.py | jjhugues/alectryon | 3ef33de5242469b1d0083c20ab7296d70ac248b6 | [
"MIT"
] | 151 | 2020-09-02T23:33:52.000Z | 2022-03-25T08:40:54.000Z | alectryon/coqc_time.py | jjhugues/alectryon | 3ef33de5242469b1d0083c20ab7296d70ac248b6 | [
"MIT"
] | 72 | 2020-11-18T05:03:33.000Z | 2022-03-21T22:54:31.000Z | alectryon/coqc_time.py | jjhugues/alectryon | 3ef33de5242469b1d0083c20ab7296d70ac248b6 | [
"MIT"
] | 21 | 2020-11-15T18:31:36.000Z | 2022-03-09T12:16:24.000Z | # Copyright © 2021 Clément Pit-Claudel
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... | 44.73913 | 99 | 0.65792 |
c8bb0ed0180fa413e44ad2fc7bd8c222f7b0bfed | 37,532 | py | Python | conans/test/utils/tools.py | NewProggie/conan | 6ec73ac2b4be98e1ab4e5ee797008b50ca2d7424 | [
"MIT"
] | null | null | null | conans/test/utils/tools.py | NewProggie/conan | 6ec73ac2b4be98e1ab4e5ee797008b50ca2d7424 | [
"MIT"
] | null | null | null | conans/test/utils/tools.py | NewProggie/conan | 6ec73ac2b4be98e1ab4e5ee797008b50ca2d7424 | [
"MIT"
] | null | null | null | import errno
import json
import os
import random
import shlex
import stat
import subprocess
import sys
import tempfile
import unittest
from collections import Counter, OrderedDict
from contextlib import contextmanager
from io import StringIO
import bottle
import requests
import shutil
import six
import threading
impor... | 37.607214 | 100 | 0.613397 |
c8bb121d9b32dac6d485a60b706cb6040713f8e1 | 302 | py | Python | examples/httpexample/views.py | gthb/celery | 13057dc69a6ecda6aabfae7b7640d971176251fb | [
"BSD-3-Clause"
] | 2 | 2021-04-30T02:01:12.000Z | 2022-02-18T05:30:28.000Z | examples/httpexample/views.py | dcramer/celery | 7aa55c5f628c29bb6bf942bc5c81feb070fe62a4 | [
"BSD-3-Clause"
] | null | null | null | examples/httpexample/views.py | dcramer/celery | 7aa55c5f628c29bb6bf942bc5c81feb070fe62a4 | [
"BSD-3-Clause"
] | null | null | null | from django.http import HttpResponse
from anyjson import serialize
def multiply(request):
x = int(request.GET["x"])
y = int(request.GET["y"])
retval = x * y
response = {"status": "success", "retval": retval}
return HttpResponse(serialize(response), mimetype="application/json")
| 23.230769 | 73 | 0.678808 |
c8bb8abe81ba0fa83d8ce2ef85fd51df11e61ea3 | 271 | py | Python | QUANTAXIS_CRAWLY_TEST/eastmoney_simulation_web_trader_test.py | simplezhang57/QUANTAXIS | 0fab23ee3cc4048a30b5eed3c311a5c9cdce8110 | [
"MIT"
] | 2 | 2018-10-29T12:01:55.000Z | 2021-03-05T10:28:59.000Z | QUANTAXIS_CRAWLY_TEST/eastmoney_simulation_web_trader_test.py | frosthaoz/QUANTAXIS | f5f482418e5f6e23ac3530089b8d17300d931b48 | [
"MIT"
] | null | null | null | QUANTAXIS_CRAWLY_TEST/eastmoney_simulation_web_trader_test.py | frosthaoz/QUANTAXIS | f5f482418e5f6e23ac3530089b8d17300d931b48 | [
"MIT"
] | 3 | 2018-11-29T07:07:56.000Z | 2021-02-09T17:24:56.000Z | from QUANTAXIS_CRAWLY.eastmoney_simulation_web_trader import EastMoneySimulationWebTrader
import unittest
class TestEastMoneySimTrader(unittest.TestCase):
def testTrader(self):
EMSimTrader = EastMoneySimulationWebTrader()
EMSimTrader.startTrade()
| 24.636364 | 89 | 0.808118 |
c8bb94674a15b9de31d7ea3ef231b0f2f3852ccc | 7,323 | py | Python | mmaction/models/recognizers/recognizer2d.py | rikichou/mmaction2 | a4db04003e7a87e68436e940178ea4c1d1b77ef0 | [
"Apache-2.0"
] | null | null | null | mmaction/models/recognizers/recognizer2d.py | rikichou/mmaction2 | a4db04003e7a87e68436e940178ea4c1d1b77ef0 | [
"Apache-2.0"
] | null | null | null | mmaction/models/recognizers/recognizer2d.py | rikichou/mmaction2 | a4db04003e7a87e68436e940178ea4c1d1b77ef0 | [
"Apache-2.0"
] | null | null | null | import torch
from torch import nn
from ..builder import RECOGNIZERS
from .base import BaseRecognizer
import cv2
import time
import os
import numpy as np
@RECOGNIZERS.register_module()
class Recognizer2D(BaseRecognizer):
"""2D recognizer model framework."""
def forward_train(self, imgs, labels, **kwargs):
... | 35.548544 | 88 | 0.546907 |
c8bbf1290e4680ec9d671b23c4cf2742dbff7a64 | 10,416 | py | Python | ariadne/widgets.py | hz-b/ariadne | e6fad3783566ddf07e4e61f670e03a86d3f1dd0f | [
"BSD-3-Clause"
] | 3 | 2021-05-27T06:23:48.000Z | 2021-08-10T18:30:44.000Z | ariadne/widgets.py | hz-b/ariadne | e6fad3783566ddf07e4e61f670e03a86d3f1dd0f | [
"BSD-3-Clause"
] | 7 | 2021-05-06T03:15:12.000Z | 2021-07-19T16:09:07.000Z | ariadne/widgets.py | hz-b/ariadne | e6fad3783566ddf07e4e61f670e03a86d3f1dd0f | [
"BSD-3-Clause"
] | 3 | 2021-05-05T19:04:48.000Z | 2021-06-30T17:06:33.000Z | """
Extendeding and supplementing the widgets import bluesky-widgets
"""
from bluesky_widgets.models.plot_builders import Lines
from bluesky_widgets.models.plot_specs import Figure, Axes
from bluesky_widgets.qt.search import QtSearch
from bluesky_widgets.qt.figures import QtFigures
from bluesky_widgets.qt.run_engine_cl... | 34.15082 | 115 | 0.684716 |
c8bc26997c834a03a4a085befce956dc41a18e51 | 2,124 | py | Python | pystol-ui/app/home/routes.py | ccamacho/pystol | 7925461c324975c8334009e3b878debcf056698b | [
"Apache-2.0"
] | null | null | null | pystol-ui/app/home/routes.py | ccamacho/pystol | 7925461c324975c8334009e3b878debcf056698b | [
"Apache-2.0"
] | null | null | null | pystol-ui/app/home/routes.py | ccamacho/pystol | 7925461c324975c8334009e3b878debcf056698b | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
from app.home import blueprint
from flask import render_template, redirect, url_for, jsonify, request
from flask_login import login_required, current_user
from app import login_manager
from jinja2 import TemplateNotFound
from app.ba... | 38.618182 | 91 | 0.655838 |
c8bc3b34b2d77a822fee8c992bcd1950b10e6210 | 8,729 | py | Python | examples/repo_example/hashed_bin_delegation.py | peip-mirror/tuf | 46979bb46d3054ca37fc0b9258574a126d975fcc | [
"Apache-2.0",
"MIT"
] | null | null | null | examples/repo_example/hashed_bin_delegation.py | peip-mirror/tuf | 46979bb46d3054ca37fc0b9258574a126d975fcc | [
"Apache-2.0",
"MIT"
] | 28 | 2022-02-11T12:20:30.000Z | 2022-03-31T10:32:08.000Z | examples/repo_example/hashed_bin_delegation.py | peip-mirror/tuf | 46979bb46d3054ca37fc0b9258574a126d975fcc | [
"Apache-2.0",
"MIT"
] | null | null | null | """
A TUF hash bin delegation example using the low-level TUF Metadata API.
The example code in this file demonstrates how to *manually* perform hash bin
delegation using the low-level Metadata API. It implements similar
functionality to that of the deprecated legacy 'repository_tool' and
'repository_lib'. (see ADR-00... | 40.041284 | 80 | 0.711651 |
c8bc5eb2019b8ca79989a006f48d2c135e99d0fd | 10,709 | py | Python | myeongsoo/code3/dkt/trainer.py | DongjaeJang/Deep-Knowledge-Tracing | aab72939a6cbdfc8b7f11bf074040b48771cbf3f | [
"Unlicense"
] | null | null | null | myeongsoo/code3/dkt/trainer.py | DongjaeJang/Deep-Knowledge-Tracing | aab72939a6cbdfc8b7f11bf074040b48771cbf3f | [
"Unlicense"
] | null | null | null | myeongsoo/code3/dkt/trainer.py | DongjaeJang/Deep-Knowledge-Tracing | aab72939a6cbdfc8b7f11bf074040b48771cbf3f | [
"Unlicense"
] | null | null | null | import os
import torch
import numpy as np
import torch.nn.functional as F
import gc
from .dataloader import get_loaders
from .optimizer import get_optimizer
from .scheduler import get_scheduler
from .criterion import get_criterion, epoch_update_gamma, ArcMarginProduct, SphereProduct
from .metric import get_metric
fro... | 33.257764 | 163 | 0.624802 |
c8bc6751add1f1e982e473954b0984df969543d4 | 241 | py | Python | alsek/__init__.py | TariqAHassan/alsek | a0d0f44d2eea1538c9d04530ae917695f624d269 | [
"MIT"
] | 1 | 2021-08-16T02:38:40.000Z | 2021-08-16T02:38:40.000Z | alsek/__init__.py | TariqAHassan/alsek | a0d0f44d2eea1538c9d04530ae917695f624d269 | [
"MIT"
] | null | null | null | alsek/__init__.py | TariqAHassan/alsek | a0d0f44d2eea1538c9d04530ae917695f624d269 | [
"MIT"
] | null | null | null | """
Alsek
"""
from alsek.core.broker import Broker
from alsek.core.concurrency import Lock
from alsek.core.message import Message
from alsek.core.status import StatusTracker
from alsek.core.task import task
__version__: str = "0.1.0"
| 18.538462 | 43 | 0.767635 |
c8bcc553462ca09f00779d62117f8ec908a68221 | 8,995 | py | Python | etl_job.py | jkwong888/composer-dataproc-pyspark-sample | 513b1a641c4c0aea5e3567987e54df2e19694c86 | [
"CNRI-Python"
] | null | null | null | etl_job.py | jkwong888/composer-dataproc-pyspark-sample | 513b1a641c4c0aea5e3567987e54df2e19694c86 | [
"CNRI-Python"
] | null | null | null | etl_job.py | jkwong888/composer-dataproc-pyspark-sample | 513b1a641c4c0aea5e3567987e54df2e19694c86 | [
"CNRI-Python"
] | null | null | null | """
etl_job.py
~~~~~~~~~~
This Python module contains an example Apache Spark ETL job definition
that implements best practices for production ETL jobs. It can be
submitted to a Spark cluster (or locally) using the 'spark-submit'
command found in the '/bin' directory of all Spark distributions
(necessary for running a... | 33.689139 | 113 | 0.682935 |
c8bcf306c15206bcddab524c86ad8787deddb96c | 43,806 | py | Python | pymatgen/io/tests/test_cif.py | nwinner/pymatgen | 45cf4533bf92430b1c183066afb2929ed0a412f1 | [
"MIT"
] | 6 | 2015-02-06T08:27:09.000Z | 2021-02-28T14:42:52.000Z | pymatgen/io/tests/test_cif.py | nwinner/pymatgen | 45cf4533bf92430b1c183066afb2929ed0a412f1 | [
"MIT"
] | null | null | null | pymatgen/io/tests/test_cif.py | nwinner/pymatgen | 45cf4533bf92430b1c183066afb2929ed0a412f1 | [
"MIT"
] | 3 | 2015-10-21T08:04:40.000Z | 2019-03-19T23:11:15.000Z | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import warnings
import numpy as np
from pymatgen.io.cif import CifParser, CifWriter, CifBlock
from pymatgen.io.vasp.inputs import Poscar
from pymatgen import Element, Specie, Lattice, Structu... | 35.49919 | 101 | 0.650139 |
c8bd168c29b8d6b1fd83b0879d4655c2323d136d | 1,409 | py | Python | var/spack/repos/builtin/packages/r-lubridate/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | var/spack/repos/builtin/packages/r-lubridate/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2021-01-08T22:23:53.000Z | 2022-03-30T11:08:17.000Z | var/spack/repos/builtin/packages/r-lubridate/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RLubridate(RPackage):
"""Functions to work with date-times and timespans: fast and user fr... | 48.586207 | 95 | 0.74379 |
c8bd19b08cf3dd2eee84153a56ebf98e95aa4d8a | 3,020 | py | Python | lib/surface/service_management/disable.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | null | null | null | lib/surface/service_management/disable.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | null | null | null | lib/surface/service_management/disable.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:23:41.000Z | 2020-07-25T12:23:41.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 38.227848 | 89 | 0.75596 |
c8bd6fe7639b01f1efdddf0af03392c137bf090d | 1,574 | py | Python | examples/grad_cam.py | LorePep/deepyeast | 4f35276b8d3a9ae03a14105c84b0746431fbf409 | [
"MIT"
] | 10 | 2018-07-18T01:44:21.000Z | 2021-09-29T13:04:19.000Z | examples/grad_cam.py | LorePep/deepyeast | 4f35276b8d3a9ae03a14105c84b0746431fbf409 | [
"MIT"
] | null | null | null | examples/grad_cam.py | LorePep/deepyeast | 4f35276b8d3a9ae03a14105c84b0746431fbf409 | [
"MIT"
] | 8 | 2018-10-04T09:53:35.000Z | 2022-01-22T14:55:29.000Z | import numpy as np
import keras.backend as K
from keras.layers import Activation, GlobalAveragePooling2D
from skimage import exposure
import matplotlib.pyplot as plt
from deepyeast.dataset import load_data
from deepyeast.utils import preprocess_input
from deepyeast.models import DeepYeast
### select model
model = Dee... | 26.233333 | 94 | 0.714104 |
c8bd77dacd5ab02c26a52fce9107ee7048810fbd | 718 | py | Python | alipay/aop/api/response/AlipayCommerceIotDeviceReportUploadResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayCommerceIotDeviceReportUploadResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayCommerceIotDeviceReportUploadResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayCommerceIotDeviceReportUploadResponse(AlipayResponse):
def __init__(self):
super(AlipayCommerceIotDeviceReportUploadResponse, self).__init__()
self._status = No... | 27.615385 | 116 | 0.715877 |
c8bdb703fed563d7ece8f32d9da85091e88f193e | 3,974 | py | Python | alipay/aop/api/request/AlipayIserviceCcmSwTreeDeleteRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayIserviceCcmSwTreeDeleteRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayIserviceCcmSwTreeDeleteRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayIserviceCcmSwTreeDeleteModel import AlipayIserviceCcmSwTreeDeleteModel
class AlipayIserviceCcmSwTreeDeleteRequest(object):
... | 27.406897 | 148 | 0.64469 |
c8bdbf9050cb169f0d4be22b2262fe1d860c7615 | 1,434 | py | Python | networkx/algorithms/tests/test_vitality.py | argriffing/networkx | 5a3d000e605be2ca567f69a4694afcba3b8acb54 | [
"BSD-3-Clause"
] | null | null | null | networkx/algorithms/tests/test_vitality.py | argriffing/networkx | 5a3d000e605be2ca567f69a4694afcba3b8acb54 | [
"BSD-3-Clause"
] | null | null | null | networkx/algorithms/tests/test_vitality.py | argriffing/networkx | 5a3d000e605be2ca567f69a4694afcba3b8acb54 | [
"BSD-3-Clause"
] | null | null | null | from nose.tools import assert_equal
import networkx as nx
class TestClosenessVitality(object):
def test_unweighted(self):
G = nx.cycle_graph(3)
vitality = nx.closeness_vitality(G)
assert_equal(vitality, {0: 2, 1: 2, 2: 2})
def test_weighted(self):
G = nx.Graph()
G.add... | 32.590909 | 69 | 0.608787 |
c8bdc2dc52925b960299d776805efba5e8f9f0d0 | 20,912 | py | Python | eucaconsole/views/__init__.py | ccassler/eucaconsole | c555728685b0d76eed65919037d442d97b6e9dd6 | [
"BSD-2-Clause"
] | null | null | null | eucaconsole/views/__init__.py | ccassler/eucaconsole | c555728685b0d76eed65919037d442d97b6e9dd6 | [
"BSD-2-Clause"
] | null | null | null | eucaconsole/views/__init__.py | ccassler/eucaconsole | c555728685b0d76eed65919037d442d97b6e9dd6 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2013-2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this... | 42.677551 | 242 | 0.619166 |
c8bdc6a570851eefeb2c913d7888f772b278763d | 2,004 | py | Python | desafios/Mundo 3/Ex092APOSENTADORIA.py | duartecgustavo/Python---Estudos- | 13a47f115dd24ef475addaed7b0c860a7b3817ca | [
"MIT"
] | 6 | 2021-01-20T20:43:39.000Z | 2021-08-13T15:44:10.000Z | desafios/Mundo 3/Ex092APOSENTADORIA.py | duartecgustavo/PythonProgress | 13a47f115dd24ef475addaed7b0c860a7b3817ca | [
"MIT"
] | null | null | null | desafios/Mundo 3/Ex092APOSENTADORIA.py | duartecgustavo/PythonProgress | 13a47f115dd24ef475addaed7b0c860a7b3817ca | [
"MIT"
] | 1 | 2020-09-06T03:34:19.000Z | 2020-09-06T03:34:19.000Z | # Desafio 92 - Aula 19 : Programa que leia o NOME, ANO DE NASCIMENTO e o numero da CARTEIRA DE TRABALHO(aleatorio).
# Caso seja digitado 0 na CTPS, nada acontece.
# Se for digitado algo, perguntar também o ANO DE CONTRATAÇÃO e o SALARIO.
# No final mostre, TODAS AS INFOS, IDADE(FORMATADA) e a IDADE DE APOSENTADORIA(35 ... | 32.322581 | 115 | 0.596307 |
c8bdd6ecc08379474bb7a0e31ec2504e92de920f | 10,396 | py | Python | opacus/grad_sample/grad_sample_module.py | nhsx-mirror/SynthVAE | 64c00dff1b9cb1fe22b4b25e585b17ca5c7b9651 | [
"MIT"
] | 2 | 2022-03-22T13:59:28.000Z | 2022-03-24T07:02:54.000Z | opacus/grad_sample/grad_sample_module.py | nhsx-mirror/SynthVAE | 64c00dff1b9cb1fe22b4b25e585b17ca5c7b9651 | [
"MIT"
] | 12 | 2022-02-17T16:29:31.000Z | 2022-03-29T15:06:42.000Z | opacus/grad_sample/grad_sample_module.py | nhsx-mirror/SynthVAE | 64c00dff1b9cb1fe22b4b25e585b17ca5c7b9651 | [
"MIT"
] | 3 | 2021-11-18T10:13:00.000Z | 2022-03-23T10:25:55.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from functools import partial
from typing import Iterable, List, Tuple
import torch
import torch.nn as nn
from opacus.layers.dp_lstm import DPLSTM, LSTMLinear
from opacus.utils.module_inspection import requires_grad
class U... | 36.605634 | 102 | 0.614467 |
c8bde3377b66d6dd85bf5d5530ecdc9e46512ba3 | 1,786 | py | Python | tests/test_configuration.py | ekiro/haps | 88d225e0177de0a0373d12d42d1b6a80437b8d5c | [
"MIT"
] | 38 | 2018-06-15T11:32:05.000Z | 2020-05-08T17:04:42.000Z | tests/test_configuration.py | lunarwings/haps | 537222b5c28244ae87d803918e1b7ede3a338cc8 | [
"MIT"
] | 6 | 2020-03-02T19:13:56.000Z | 2020-12-03T06:00:38.000Z | tests/test_configuration.py | ekiro/haps | 88d225e0177de0a0373d12d42d1b6a80437b8d5c | [
"MIT"
] | 2 | 2019-05-17T09:58:36.000Z | 2019-06-10T08:18:48.000Z | import pytest
from haps.config import Config, Configuration
@pytest.fixture
def base_config():
Configuration.set('var_a', 'a')
Configuration.set('var_b', 3)
@Configuration.resolver('var_c')
def _() -> str:
return 'c'
@pytest.fixture
def env_config(monkeypatch):
monkeypatch.setenv('HAPS... | 27.060606 | 73 | 0.643897 |
c8bde5dc215ecb48676d740bcd8c29c5d68fd8a1 | 25,713 | py | Python | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.616667 | 302 | 0.699413 |
c8be1540c668ecaec724a925ca5506b82f4387f9 | 13,028 | py | Python | synapse/lib/crypto/vault.py | larrycameron80/synapse | 24bf21c40b4a467e5dc28c8204aecaf502d5cddf | [
"Apache-2.0"
] | null | null | null | synapse/lib/crypto/vault.py | larrycameron80/synapse | 24bf21c40b4a467e5dc28c8204aecaf502d5cddf | [
"Apache-2.0"
] | null | null | null | synapse/lib/crypto/vault.py | larrycameron80/synapse | 24bf21c40b4a467e5dc28c8204aecaf502d5cddf | [
"Apache-2.0"
] | null | null | null | import os
import hashlib
import logging
import contextlib
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.eventbus as s_eventbus
import synapse.lib.kv as s_kv
import synapse.lib.msgpack as s_msgpack
import synapse.lib.crypto.rsa as s_rsa
logger = logging.getLogger(__name__)
uservault =... | 24.910134 | 88 | 0.548971 |
c8be51d0db112095ed71474a5a4b296288ac8012 | 1,095 | py | Python | rlkit/envs/mujoco/twod_maze.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | rlkit/envs/mujoco/twod_maze.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | rlkit/envs/mujoco/twod_maze.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | import numpy as np
from rlkit.envs.mujoco.mujoco_env import MujocoEnv
INIT_POS = np.array([0.2,0.15])
TARGET = np.array([0.2, -0.15]) + INIT_POS
DIST_THRESH = 0.05
class TwoDMaze(MujocoEnv):
def __init__(self):
self.init_serialization(locals())
super().__init__('twod_maze.xml')
def _step(se... | 29.594595 | 96 | 0.625571 |
c8be717c4972cdee5137ee7d3b824f4680d88f66 | 5,934 | py | Python | scripts/python/backend_server/wsgi/log.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | 2 | 2020-06-03T15:59:50.000Z | 2020-12-21T11:11:57.000Z | scripts/python/backend_server/wsgi/log.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | null | null | null | scripts/python/backend_server/wsgi/log.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | 2 | 2019-10-02T06:47:23.000Z | 2020-02-02T18:32:23.000Z | #!/usr/bin/env python
"A class for logging messages in daily log files."
# *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
# ** Copyright UCAR (c) 1992 - 2015
# ** University Corporation for Atmospheric Research(UCAR)
# ** National Center for Atmospheric Research(NCAR)
# ** Research Appl... | 29.969697 | 169 | 0.54331 |
c8be7e7aa5a128b677fe9fb4674a03937980aa07 | 2,901 | py | Python | CourseraMOOCdbTranslate/program/piping_scripts/collaborations.py | rcmurray/WorkflowComponents | 368f8132ce5bef3ac3fb9d8e1a13a08f91764cfa | [
"BSD-4-Clause-UC"
] | 26 | 2016-09-14T18:15:29.000Z | 2021-12-01T20:01:29.000Z | CourseraMOOCdbTranslate/program/piping_scripts/collaborations.py | rcmurray/WorkflowComponents | 368f8132ce5bef3ac3fb9d8e1a13a08f91764cfa | [
"BSD-4-Clause-UC"
] | 122 | 2017-09-12T15:22:03.000Z | 2021-09-27T17:25:08.000Z | CourseraMOOCdbTranslate/program/piping_scripts/collaborations.py | rcmurray/WorkflowComponents | 368f8132ce5bef3ac3fb9d8e1a13a08f91764cfa | [
"BSD-4-Clause-UC"
] | 17 | 2017-02-16T16:04:41.000Z | 2021-02-06T05:36:44.000Z | from utilities import db
def TransformCollaborationData(vars):
collaboration_id_maps = {}
fields = {
'collaboration_id': 'num',
'collaboration_type_id': 'num',
'user_id': 'num',
'resource_id': 'num',
'collaboration_content': 'string',
'collaboration_timestam... | 39.202703 | 135 | 0.572561 |
c8be8be1552278ceb014f9c8abe604727fc4f153 | 1,833 | py | Python | py/action.py | triffid/kiki | b64b8524063c149a5cc9118f48d80afec1d8a942 | [
"Unlicense"
] | 2 | 2020-01-04T23:44:10.000Z | 2020-07-12T17:10:09.000Z | py/action.py | triffid/kiki | b64b8524063c149a5cc9118f48d80afec1d8a942 | [
"Unlicense"
] | null | null | null | py/action.py | triffid/kiki | b64b8524063c149a5cc9118f48d80afec1d8a942 | [
"Unlicense"
] | 1 | 2022-03-16T05:43:33.000Z | 2022-03-16T05:43:33.000Z |
if Controller.isDebugVersion(): print("[action.py]")
# .................................................................................................................
class KikiPyActionObject:
def __init__(self):
self.action_dict = {}
def performAction(self, name, time):
if name in sel... | 40.733333 | 115 | 0.552646 |
c8bee5282895d656509535347670513fda985013 | 2,227 | py | Python | py/0733.flood-fill.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | py/0733.flood-fill.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | py/0733.flood-fill.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=733 lang=python3
#
# [733] Flood Fill
#
# https://leetcode.com/problems/flood-fill/description/
#
# algorithms
# Easy (55.48%)
# Likes: 1712
# Dislikes: 229
# Total Accepted: 212.2K
# Total Submissions: 380K
# Testcase Example: '[[1,1,1],[1,1,0],[1,0,1]]\n1\n1\n2'
#
#
# An image is repre... | 30.094595 | 100 | 0.625505 |
c8beea49e8495c2b6278eb45b572e142171811d7 | 11,460 | py | Python | data/level/level50.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | null | null | null | data/level/level50.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | 6 | 2020-07-04T02:53:08.000Z | 2022-03-11T23:53:14.000Z | data/level/level50.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | 3 | 2019-12-31T11:42:59.000Z | 2021-03-28T20:06:13.000Z | data = {
'level_index': 50,
'move_count': 30,
'board_info': {
(0, 0): {
'base': (50, 1),
'cover': (64, 2),
'next': (1, 0),
'prev': (0, 1)
},
(0, 1): {
'next': (0, -1),
'prev': (0, 1)
},
(0, 2): {
... | 24.07563 | 65 | 0.207853 |
c8bef0dbc638358d8dc9dc5fc99e317b582da235 | 6,278 | py | Python | iniesta/sqs/message.py | crazytruth/iniesta | 1e1cc079d04758f319c6bcee4a8a14a176e7b24e | [
"MIT"
] | 1 | 2021-03-14T08:27:43.000Z | 2021-03-14T08:27:43.000Z | iniesta/sqs/message.py | crazytruth/iniesta | 1e1cc079d04758f319c6bcee4a8a14a176e7b24e | [
"MIT"
] | 1 | 2020-10-08T08:14:04.000Z | 2020-10-08T08:14:04.000Z | iniesta/sqs/message.py | crazytruth/iniesta | 1e1cc079d04758f319c6bcee4a8a14a176e7b24e | [
"MIT"
] | null | null | null | from typing import Any
import hashlib
import ujson as json
from botocore.exceptions import ClientError
from insanic.conf import settings
from iniesta.log import error_logger
from iniesta.messages import MessageAttributes
from iniesta.sessions import BotoSession
empty = object()
VALID_SEND_MESSAGE_ARGS = [
"Mess... | 31.547739 | 140 | 0.590475 |
c8bf1dc82c5b887a8a3eed8b41fc5582b7b58243 | 16,580 | py | Python | sharpy/solvers/staticcoupled.py | AntonioWR/sharpy | c922be8d5a1831c4624b22f39264e2f417a03deb | [
"BSD-3-Clause"
] | null | null | null | sharpy/solvers/staticcoupled.py | AntonioWR/sharpy | c922be8d5a1831c4624b22f39264e2f417a03deb | [
"BSD-3-Clause"
] | null | null | null | sharpy/solvers/staticcoupled.py | AntonioWR/sharpy | c922be8d5a1831c4624b22f39264e2f417a03deb | [
"BSD-3-Clause"
] | null | null | null | import ctypes as ct
import sys
import numpy as np
import sharpy.aero.utils.mapping as mapping
import sharpy.utils.cout_utils as cout
import sharpy.utils.solver_interface as solver_interface
from sharpy.utils.solver_interface import solver, BaseSolver
import sharpy.utils.settings as settings
import sharpy.utils.algebra... | 46.968839 | 136 | 0.612002 |
c8bf436bcf391576fe61cc56a5d3b03da6a70048 | 3,623 | py | Python | setup.py | eddiethedean/solaris | ca575414f6e36aed48057812c47bacb7b94141da | [
"Apache-2.0"
] | null | null | null | setup.py | eddiethedean/solaris | ca575414f6e36aed48057812c47bacb7b94141da | [
"Apache-2.0"
] | null | null | null | setup.py | eddiethedean/solaris | ca575414f6e36aed48057812c47bacb7b94141da | [
"Apache-2.0"
] | null | null | null | import os
import sys
import subprocess
import logging
from setuptools import setup, find_packages
import re
def get_version():
VERSIONFILE = os.path.join('solaris', '__init__.py')
initfile_lines = open(VERSIONFILE, 'rt').readlines()
VSRE = r'^__version__ = [\"\']*([\d\w.]+)[\"\']'
for line in initfile... | 30.965812 | 100 | 0.574662 |
c8bf4d05e56ce4353145208ff486202468533051 | 135 | py | Python | testing/test_routing.py | brianjpetersen/classy | 22f117e3567cf7ae1adf0b7283d040bb70d096a7 | [
"MIT"
] | null | null | null | testing/test_routing.py | brianjpetersen/classy | 22f117e3567cf7ae1adf0b7283d040bb70d096a7 | [
"MIT"
] | null | null | null | testing/test_routing.py | brianjpetersen/classy | 22f117e3567cf7ae1adf0b7283d040bb70d096a7 | [
"MIT"
] | null | null | null | # standard libraries
import doctest
# third party libraries
pass
# first party libraries
import classy
doctest.testmod(classy.routing) | 16.875 | 31 | 0.822222 |
c8bf4d3acabeee5edb0e9f6db2acce6840d691ce | 1,584 | py | Python | Internet-Worm/venv_macos/lib/python3.8/site-packages/pyecharts/charts/basic_charts/funnel.py | Qiaozhi94/Python-Projects | aefc6cf49c1f4f2cc9beba8dbe80cfa826ba75c4 | [
"MIT"
] | 1 | 2020-05-12T13:30:03.000Z | 2020-05-12T13:30:03.000Z | Internet-Worm/venv_macos/lib/python3.8/site-packages/pyecharts/charts/basic_charts/funnel.py | Qiaozhi94/Python-Projects | aefc6cf49c1f4f2cc9beba8dbe80cfa826ba75c4 | [
"MIT"
] | null | null | null | Internet-Worm/venv_macos/lib/python3.8/site-packages/pyecharts/charts/basic_charts/funnel.py | Qiaozhi94/Python-Projects | aefc6cf49c1f4f2cc9beba8dbe80cfa826ba75c4 | [
"MIT"
] | null | null | null | from ... import options as opts
from ... import types
from ...charts.chart import Chart
from ...globals import ChartType
class Funnel(Chart):
"""
<<< Funnel >>>
Funnel diagram is suitable for one-way analysis of single process
with standardized business process, long cycle and multiple links.
Thr... | 30.461538 | 70 | 0.565025 |
c8bf53115f699cb8ac9a682047f7b84ae276753a | 7,906 | py | Python | pytorch/caffe2/contrib/fakelowp/test/test_sls_4bit_nnpi_fp16.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/caffe2/contrib/fakelowp/test/test_sls_4bit_nnpi_fp16.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/caffe2/contrib/fakelowp/test/test_sls_4bit_nnpi_fp16.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import unittest
# Must happen before importing caffe2.python.*
import caffe2.python.fakelowp.init_shared_libs # noqa
from hypothesis import given, s... | 35.936364 | 98 | 0.574627 |
c8bf6a8d532b9d551e5c6025b6ab015ef4c9c507 | 2,341 | py | Python | regparser/notice/build_appendix.py | cfpb/regulations-parser | 9b6e1ab2dbec93a915eb6da9a2d88c723b9ac424 | [
"CC0-1.0"
] | 36 | 2015-01-05T21:17:36.000Z | 2020-04-28T21:02:55.000Z | regparser/notice/build_appendix.py | DalavanCloud/regulations-parser | 9b6e1ab2dbec93a915eb6da9a2d88c723b9ac424 | [
"CC0-1.0"
] | 49 | 2015-01-28T15:54:25.000Z | 2018-08-20T20:20:08.000Z | regparser/notice/build_appendix.py | DalavanCloud/regulations-parser | 9b6e1ab2dbec93a915eb6da9a2d88c723b9ac424 | [
"CC0-1.0"
] | 23 | 2015-01-28T15:34:18.000Z | 2021-02-20T10:53:34.000Z | from copy import deepcopy
from itertools import dropwhile
import logging
from regparser.notice.diff import DesignateAmendment
from regparser.tree.struct import Node
from regparser.tree.xml_parser.appendices import process_appendix
def _is_appendix_amend(al):
"""Serves as a guard/filter to distinguish appendix am... | 41.070175 | 79 | 0.63947 |
c8bf6bdbd4eed5cbc53fbcba512a07e9c0d626ad | 4,427 | py | Python | xgb-1.py | nicapotato/KaggleNotebooks | 5fea648e99a92d21710c635db48c808c3ece82b3 | [
"MIT"
] | null | null | null | xgb-1.py | nicapotato/KaggleNotebooks | 5fea648e99a92d21710c635db48c808c3ece82b3 | [
"MIT"
] | null | null | null | xgb-1.py | nicapotato/KaggleNotebooks | 5fea648e99a92d21710c635db48c808c3ece82b3 | [
"MIT"
] | 1 | 2021-12-03T11:28:09.000Z | 2021-12-03T11:28:09.000Z | # Classification CatBoost for Home Credit Default Risk Kaggle Competition
# By Nick Brooks, May 2018 [Other Kaggler's work also used, citation throughout]
# https://www.kaggle.com/c/home-credit-default-risk
import time
notebookstart = time.time()
# General
import numpy as np # linear algebra
import pandas as pd # dat... | 34.585938 | 141 | 0.702733 |
c8bf8f0b3778e5e9407ba49b6bf12620c9a84d58 | 4,873 | py | Python | acme/agents/tf/mompo/agent_test.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 2,650 | 2020-06-01T16:31:25.000Z | 2022-03-31T07:32:41.000Z | acme/agents/tf/mompo/agent_test.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 199 | 2020-06-02T01:09:09.000Z | 2022-03-31T17:11:20.000Z | acme/agents/tf/mompo/agent_test.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 344 | 2020-06-01T16:45:21.000Z | 2022-03-30T11:15:09.000Z | # python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 32.486667 | 78 | 0.716807 |
c8bfc9dce7f3142aeb06f9a583821e70e5881b20 | 26,132 | py | Python | distributed/protocol/serialize.py | vepadulano/distributed | 1da51994cc84c0897589a4476cd24073147054b6 | [
"BSD-3-Clause"
] | null | null | null | distributed/protocol/serialize.py | vepadulano/distributed | 1da51994cc84c0897589a4476cd24073147054b6 | [
"BSD-3-Clause"
] | null | null | null | distributed/protocol/serialize.py | vepadulano/distributed | 1da51994cc84c0897589a4476cd24073147054b6 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
import importlib
import traceback
from array import array
from enum import Enum
from functools import partial
from types import ModuleType
import msgpack
import dask
from dask.base import normalize_token
from dask.utils import typename
from distributed.protocol import pickle
from ... | 30.140715 | 86 | 0.610439 |
c8bfdfc2747c3aabeb1822b064011118ce7b40fc | 66,063 | py | Python | chemicals/utils.py | volpatto/chemicals | 721904ee17604f5e8685b0e5fff12e0bac567f73 | [
"MIT"
] | null | null | null | chemicals/utils.py | volpatto/chemicals | 721904ee17604f5e8685b0e5fff12e0bac567f73 | [
"MIT"
] | null | null | null | chemicals/utils.py | volpatto/chemicals | 721904ee17604f5e8685b0e5fff12e0bac567f73 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, 2017, 2018, 2019, 2020 Caleb Bell
<Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (t... | 30.207133 | 213 | 0.597642 |
c8bff542ced90a9bfe0e58b498fca1674b728bdd | 2,580 | py | Python | test/arthash/journals/keeper_test.py | arthash/arthash | 8d59700308cedf3b62118ed021064b677408edeb | [
"Artistic-2.0"
] | 2 | 2016-05-26T19:57:40.000Z | 2018-09-18T04:10:08.000Z | test/arthash/journals/keeper_test.py | arthash/arthash | 8d59700308cedf3b62118ed021064b677408edeb | [
"Artistic-2.0"
] | 12 | 2018-06-23T12:07:42.000Z | 2018-07-21T14:44:42.000Z | test/arthash/journals/keeper_test.py | arthash/arthash | 8d59700308cedf3b62118ed021064b677408edeb | [
"Artistic-2.0"
] | 1 | 2016-05-26T21:08:08.000Z | 2016-05-26T21:08:08.000Z | import json, os, unittest
from unittest.mock import patch
from pyfakefs.fake_filesystem_unittest import TestCase
from arthash.journals import keeper
BASE = os.path.dirname(__file__)
class KeeperTest(TestCase):
def setUp(self):
self.setUpPyfakefs()
def run_test(self, last1, page1, last2, page2):
... | 30 | 74 | 0.642636 |
c8c032ae85c612c75ac712318b4796958b5dd32d | 2,574 | py | Python | jedeschule/pipelines/db_pipeline.py | k-nut/jedeschule-scraper | feb8141513174b1fc0c52433dcc8d99f0a141586 | [
"MIT"
] | 15 | 2017-03-15T11:06:13.000Z | 2022-02-10T12:20:56.000Z | jedeschule/pipelines/db_pipeline.py | k-nut/jedeschule-scraper | feb8141513174b1fc0c52433dcc8d99f0a141586 | [
"MIT"
] | 80 | 2016-11-29T14:42:46.000Z | 2021-08-14T15:41:18.000Z | jedeschule/pipelines/db_pipeline.py | k-nut/jedeschule-scraper | feb8141513174b1fc0c52433dcc8d99f0a141586 | [
"MIT"
] | 14 | 2017-06-06T14:36:26.000Z | 2021-09-26T12:39:04.000Z | from __future__ import annotations # needed so that update_or_create can define School return type
import logging
import os
from geoalchemy2 import Geometry, WKTElement
from sqlalchemy import String, Column, JSON
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.ext.declarative import declarative_base
from ... | 31.390244 | 105 | 0.676379 |
c8c03742add3a638055cdaecc29a177d086deda3 | 3,311 | py | Python | ckanext/ckanext-apicatalog_scheming/setup.py | eetumans/api-catalog | a32a52c48425be8b71d83c60c93b26db7787e632 | [
"MIT"
] | null | null | null | ckanext/ckanext-apicatalog_scheming/setup.py | eetumans/api-catalog | a32a52c48425be8b71d83c60c93b26db7787e632 | [
"MIT"
] | null | null | null | ckanext/ckanext-apicatalog_scheming/setup.py | eetumans/api-catalog | a32a52c48425be8b71d83c60c93b26db7787e632 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'README.rst'), encoding='utf-8') as... | 38.5 | 98 | 0.694352 |
c8c04c9fe0e22effbb4fcf0a3e9d0a7e5871b8a0 | 7,333 | py | Python | species/core/box.py | vandalt/species | 527dd900a60c4d691bd490569cd3b2007f9beead | [
"MIT"
] | null | null | null | species/core/box.py | vandalt/species | 527dd900a60c4d691bd490569cd3b2007f9beead | [
"MIT"
] | null | null | null | species/core/box.py | vandalt/species | 527dd900a60c4d691bd490569cd3b2007f9beead | [
"MIT"
] | null | null | null | """
Box module.
"""
def create_box(boxtype,
**kwargs):
"""
Returns
-------
species.core.box
"""
if boxtype == 'colormag':
box = ColorMagBox()
box.library = kwargs['library']
box.object_type = kwargs['object_type']
box.filters_color = kwargs['filt... | 20.773371 | 51 | 0.492431 |
c8c05061c546b7d38efe144ab295973cc63a6e56 | 3,204 | py | Python | src/lib/Bcfg2/Client/Tools/Pacman.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | src/lib/Bcfg2/Client/Tools/Pacman.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | src/lib/Bcfg2/Client/Tools/Pacman.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | """This is the bcfg2 support for pacman"""
import Bcfg2.Client.Tools
class Pacman(Bcfg2.Client.Tools.PkgTool):
'''Archlinux package support'''
name = 'Pacman'
__execs__ = ["/usr/bin/pacman"]
__handles__ = [('Package', 'pacman')]
__req__ = {'Package': ['name', 'version']}
pkgtype = 'pacman'
... | 38.142857 | 81 | 0.540262 |
c8c06473ad1d3dc33d105aca49eee49900b1e212 | 2,654 | py | Python | connectivity_matrix_neo/ConnectivityMatrix.py | visdesignlab/graffinity_server | fdccfe361fec1303d2e6d886573c415ee7b4c5cc | [
"MIT"
] | 3 | 2017-03-29T19:41:17.000Z | 2019-02-15T21:38:12.000Z | connectivity_matrix_neo/ConnectivityMatrix.py | visdesignlab/graffinity_server | fdccfe361fec1303d2e6d886573c415ee7b4c5cc | [
"MIT"
] | null | null | null | connectivity_matrix_neo/ConnectivityMatrix.py | visdesignlab/graffinity_server | fdccfe361fec1303d2e6d886573c415ee7b4c5cc | [
"MIT"
] | 2 | 2017-08-03T14:39:20.000Z | 2018-02-22T00:40:53.000Z | class ConnectivityMatrix:
""" Class for creating a matrix representation of multi-hop relationships in neo4j databases.
"""
def __init__(self, path_list, node_id_key, edge_id_key):
self.node_id_key = node_id_key
self.edge_id_key = edge_id_key
self._paths = []
self._source_id... | 36.861111 | 97 | 0.64205 |
c8c0b303c3381bdb0d7b4b1695d0e01282b2eca2 | 919 | py | Python | src/visitpy/visitmodule/setup.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/visitpy/visitmodule/setup.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/visitpy/visitmodule/setup.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
###############################################################################
# file: setup.py
# ... | 27.029412 | 79 | 0.594124 |
c8c0bda8c162e8ccd1a7f416681cdab66485cf25 | 2,441 | py | Python | luminos/core/AbstractApplication.py | linuxaddict89/luminos | cd525173bd6766eb109c4409581f6c6273d1c1bd | [
"MIT"
] | null | null | null | luminos/core/AbstractApplication.py | linuxaddict89/luminos | cd525173bd6766eb109c4409581f6c6273d1c1bd | [
"MIT"
] | 2 | 2021-10-03T08:44:45.000Z | 2021-10-03T08:49:49.000Z | luminos/core/AbstractApplication.py | linuxaddict89/luminos | cd525173bd6766eb109c4409581f6c6273d1c1bd | [
"MIT"
] | null | null | null | import os
import sys
from os import path
import typing
import gettext
from PyQt5.QtWidgets import QApplication
from luminos.core.Signal import Signal
from luminos.core.AbstractWindow import AbstractWindow
from luminos.utils import utils, log, standarddir
from luminos.utils import config
from luminos.utils.config impor... | 28.057471 | 117 | 0.664072 |
c8c112c3984c885606c691196e9f2d294d482b29 | 346 | py | Python | owtf/plugins/network/active/X11@PTES-004.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | owtf/plugins/network/active/X11@PTES-004.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | owtf/plugins/network/active/X11@PTES-004.py | alienus/owtf | b6d81fac83c324c2b8c6fe2a974c036881c1fcd0 | [
"BSD-3-Clause"
] | null | null | null | """
Plugin for probing x11
"""
from owtf.managers.resource import get_resources
from owtf.plugin.plugin_helper import plugin_helper
DESCRIPTION = " x11 Probing "
def run(PluginInfo):
resource = get_resources('X11ProbeMethods')
return plugin_helper.CommandDump('Test Command', 'Output', resource, PluginInfo, ... | 24.714286 | 110 | 0.757225 |
c8c18f892b87d175019dc144d98d837a48c42170 | 4,125 | py | Python | snf/utils/toeplitz.py | AnonICML/SelfNormalizingFlows | f924e786b83e4766241c6ece90b5195a3acc9e64 | [
"MIT"
] | 66 | 2020-11-17T12:06:52.000Z | 2022-02-05T23:58:15.000Z | snf/utils/toeplitz.py | AnonICML/SelfNormalizingFlows | f924e786b83e4766241c6ece90b5195a3acc9e64 | [
"MIT"
] | 1 | 2021-07-26T19:29:32.000Z | 2021-07-27T16:23:03.000Z | snf/utils/toeplitz.py | AnonICML/SelfNormalizingFlows | f924e786b83e4766241c6ece90b5195a3acc9e64 | [
"MIT"
] | 8 | 2020-11-17T17:42:51.000Z | 2022-03-14T14:12:37.000Z | from itertools import product
import math
import torch
import torch.nn.functional as F
def im2toepidx(c, i, j, h, w):
return c*h*w + i*w + j
def get_toeplitz_idxs(fshape, dshape, f_stride=(1,1), s_pad=(0,0)):
assert fshape[1] == dshape[0], "data channels must match filters channels"
fh, fw = fshape[-2:]
... | 35.560345 | 95 | 0.524121 |
c8c1e6f825ba174ffd8d9b826e0089ea242e752f | 1,569 | py | Python | tests/app/service/test_schema.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | tests/app/service/test_schema.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | tests/app/service/test_schema.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | import json
import uuid
import pytest
from jsonschema import ValidationError
from app.schema_validation import validate
from app.service.service_callback_api_schema import update_service_callback_api_schema
def test_service_callback_api_schema_validates():
under_test = {
"url": "https://some_url.for_ser... | 32.020408 | 86 | 0.705545 |
c8c1e9917b0626ef3bc15ff702d784c4cef64f87 | 1,700 | py | Python | flask_social/providers/facebook.py | rmoskal/flask-social | fb04319cc1c0422518d5e2b2aaa1a54a36313f02 | [
"MIT"
] | 1 | 2017-01-10T17:12:18.000Z | 2017-01-10T17:12:18.000Z | flask_social/providers/facebook.py | rmoskal/flask-social | fb04319cc1c0422518d5e2b2aaa1a54a36313f02 | [
"MIT"
] | null | null | null | flask_social/providers/facebook.py | rmoskal/flask-social | fb04319cc1c0422518d5e2b2aaa1a54a36313f02 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
flask.ext.social.providers.facebook
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains the Flask-Social facebook code
:copyright: (c) 2012 by Matt Wright.
:license: MIT, see LICENSE for more details.
"""
from __future__ import absolute_import
import facebook
co... | 27.419355 | 93 | 0.645294 |
c8c2060bdabd01b82afa5d5c147199f7684b2255 | 1,193 | py | Python | battleforcastile/utils/find_or_create_match.py | battleforcastile/battleforcastile | 65223fcb56ecc550f1a7c7b70beadff22c866d85 | [
"MIT"
] | null | null | null | battleforcastile/utils/find_or_create_match.py | battleforcastile/battleforcastile | 65223fcb56ecc550f1a7c7b70beadff22c866d85 | [
"MIT"
] | 1 | 2021-08-21T10:16:03.000Z | 2021-08-21T10:16:03.000Z | battleforcastile/utils/find_or_create_match.py | battleforcastile/battleforcastile | 65223fcb56ecc550f1a7c7b70beadff22c866d85 | [
"MIT"
] | null | null | null | import time
import click
from battleforcastile.exceptions import MatchCouldNotBeCreatedException, MatchNotFoundException
from battleforcastile.utils.create_match import create_match
from battleforcastile.utils.get_latest_non_started_match_created_by_username import get_latest_non_started_match_created_by_username
fro... | 31.394737 | 132 | 0.715842 |
c8c25a7dfe3731ae7d0737dee68527526bba652c | 11,089 | py | Python | xos/core/models/plcorebase.py | xmaruto/mcord | 3678a3d10c3703c2b73f396c293faebf0c82a4f4 | [
"Apache-2.0"
] | null | null | null | xos/core/models/plcorebase.py | xmaruto/mcord | 3678a3d10c3703c2b73f396c293faebf0c82a4f4 | [
"Apache-2.0"
] | null | null | null | xos/core/models/plcorebase.py | xmaruto/mcord | 3678a3d10c3703c2b73f396c293faebf0c82a4f4 | [
"Apache-2.0"
] | null | null | null | import datetime
import json
import os
import sys
from django import db
from django.db import models
from django.forms.models import model_to_dict
from django.core.urlresolvers import reverse
from django.forms.models import model_to_dict
from django.utils import timezone
from django.core.exceptions import PermissionDeni... | 35.541667 | 157 | 0.63306 |
c8c2784e9d773348eeaa8a44f5515026100960cf | 6,479 | py | Python | external/sbml/bindings/python/test/sbml/TestReadFromFile3.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | 1 | 2019-08-22T17:17:41.000Z | 2019-08-22T17:17:41.000Z | external/sbml/bindings/python/test/sbml/TestReadFromFile3.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | null | null | null | external/sbml/bindings/python/test/sbml/TestReadFromFile3.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | null | null | null | #
# @file TestReadFromFile3.py
# @brief Reads tests/l1v1-rules.xml into memory and tests it.
#
# @author Akiya Jouraku (Python conversion)
# @author Ben Bornstein
#
# $Id: TestReadFromFile3.py 8704 2009-01-04 02:26:05Z mhucka $
# $HeadURL: https://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml/src/bindings... | 39.748466 | 124 | 0.608736 |
c8c27ec5ce0e5ce6189b9cd99a67e0fbff9a61e1 | 601 | py | Python | tests/test_merge_templates_duplicate_ids.py | iulica/docx-mailmerge | 55ce8cabb8ba199282a246da56117cd7764c5535 | [
"MIT"
] | 2 | 2022-03-09T16:53:59.000Z | 2022-03-22T14:11:05.000Z | tests/test_merge_templates_duplicate_ids.py | iulica/docx-mailmerge | 55ce8cabb8ba199282a246da56117cd7764c5535 | [
"MIT"
] | 3 | 2022-03-22T14:06:39.000Z | 2022-03-28T12:39:57.000Z | tests/test_merge_templates_duplicate_ids.py | iulica/docx-mailmerge | 55ce8cabb8ba199282a246da56117cd7764c5535 | [
"MIT"
] | null | null | null | import unittest
import tempfile
from os import path
from lxml import etree
from mailmerge import MailMerge, NAMESPACES
from tests.utils import EtreeMixin, get_document_body_part
DOCPR_TAG = 'wp:docPr'
class MergeTemplatesWithPicturesTest(EtreeMixin, unittest.TestCase):
def test_duplicate_docPr(self):
do... | 28.619048 | 76 | 0.72213 |
c8c2a0f19ead2d4909db9fd1239d14fca53ecc8a | 7,282 | py | Python | TensorFlow_part/data_util.py | tuili/PAr142 | 8ccc538469350d99480a65664d8665d63aa97f27 | [
"Apache-2.0"
] | null | null | null | TensorFlow_part/data_util.py | tuili/PAr142 | 8ccc538469350d99480a65664d8665d63aa97f27 | [
"Apache-2.0"
] | null | null | null | TensorFlow_part/data_util.py | tuili/PAr142 | 8ccc538469350d99480a65664d8665d63aa97f27 | [
"Apache-2.0"
] | 1 | 2019-03-02T11:55:37.000Z | 2019-03-02T11:55:37.000Z | """
Description
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import re
import os
from random import choice, shuffle
import nltk
def clean_str(string):
"""
Tokenization/string cleaning for all datasets except for SST.
O... | 32.221239 | 92 | 0.571684 |
c8c2baf4fd0ff388253d3c9048033d766e4ad5c1 | 3,847 | py | Python | mac-py27-venv-designateclient/v2/cli/reverse.py | naototty/python-conohadns-client | 04f360450d2e1a6020d2870272d8125cb112fa01 | [
"Apache-2.0"
] | null | null | null | mac-py27-venv-designateclient/v2/cli/reverse.py | naototty/python-conohadns-client | 04f360450d2e1a6020d2870272d8125cb112fa01 | [
"Apache-2.0"
] | null | null | null | mac-py27-venv-designateclient/v2/cli/reverse.py | naototty/python-conohadns-client | 04f360450d2e1a6020d2870272d8125cb112fa01 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Endre Karlson <endre.karlson@hp.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lice... | 31.276423 | 79 | 0.695087 |
c8c2c9b10f0d97214bc279544faf347643c205e0 | 2,058 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_update_parameters.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_update_parameters.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_04_01/models/source_update_parameters.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 44.73913 | 117 | 0.673955 |
c8c2d8827efc3e3e04ff4177ee8e8e479bd2492f | 2,026 | py | Python | contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/test_trailing_whitespace.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | null | null | null | contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/test_trailing_whitespace.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | null | null | null | contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/test_trailing_whitespace.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | 1 | 2019-06-10T17:24:34.000Z | 2019-06-10T17:24:34.000Z | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants_test.cont... | 31.169231 | 98 | 0.597236 |
c8c2ec3b5564bf92cc55bb8f0d13dae73136950c | 3,076 | py | Python | resources/lib/services/playback/section_skipping.py | helviojr/plugin.video.netflix | f79811835c998709668f94fd350bdf428d797c64 | [
"MIT"
] | 15 | 2018-12-29T18:11:00.000Z | 2019-03-23T19:45:21.000Z | resources/lib/services/playback/section_skipping.py | helviojr/plugin.video.netflix | f79811835c998709668f94fd350bdf428d797c64 | [
"MIT"
] | 3 | 2019-01-06T14:57:58.000Z | 2019-01-28T20:38:35.000Z | resources/lib/services/playback/section_skipping.py | wintuxx/plugin.video.netflix | 7db7f6398a91fdf064d4fd1cc0fdb1b08f0a39a9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Skipping of video sections (recap, intro)"""
from __future__ import unicode_literals
import xbmc
from resources.lib.globals import g
import resources.lib.common as common
import resources.lib.kodi.ui as ui
from .action_manager import PlaybackActionManager
from .markers import SKIPPABLE_SEC... | 37.975309 | 79 | 0.604681 |
c8c34dfb1160911b016255e1e7bb3c9e05cf5e7f | 1,020 | py | Python | src/graph_transpiler/webdnn/graph/operators/softmax.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | 1 | 2018-07-26T13:52:21.000Z | 2018-07-26T13:52:21.000Z | src/graph_transpiler/webdnn/graph/operators/softmax.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | src/graph_transpiler/webdnn/graph/operators/softmax.py | gunpowder78/webdnn | c659ea49007f91d178ce422a1eebe289516a71ee | [
"MIT"
] | null | null | null | from typing import Optional
from webdnn.graph.axis import Axis
from webdnn.graph.operator import Operator
from webdnn.graph.operators.attributes.inplace import InplaceOperator
from webdnn.graph.variable import Variable
class Softmax(Operator):
"""Softmax(name, axis)
Softmax operator.
Args:
name... | 24.878049 | 77 | 0.611765 |
c8c36487083bb21d9c1fb87299d96fb1088f3602 | 19,874 | bzl | Python | haskell/ghc_bindist.bzl | dasormeter/rules_haskell | 631531550468eca22cce0cd4619009c725e3be92 | [
"Apache-2.0"
] | null | null | null | haskell/ghc_bindist.bzl | dasormeter/rules_haskell | 631531550468eca22cce0cd4619009c725e3be92 | [
"Apache-2.0"
] | null | null | null | haskell/ghc_bindist.bzl | dasormeter/rules_haskell | 631531550468eca22cce0cd4619009c725e3be92 | [
"Apache-2.0"
] | null | null | null | """Workspace rules (GHC binary distributions)"""
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "patch")
load("@rules_sh//sh:posix.bzl", "sh_posix_configure")
load(":private/workspace_utils.bzl", "execute_or_fail_loudly")
_GHC_DEFAULT_VERSION = "8.6.5"
# Generated with `bazel run @rules_haskell//haskell:gen-g... | 41.318087 | 138 | 0.607376 |
c8c3694bc83d2f99fb10172f546c7c49047670e6 | 119 | py | Python | gala-spider/spider/service/__init__.py | seandong37tt4qu/jeszhengq | 32b3737ab45e89e8c5b71cdce871cefd2c938fa8 | [
"MulanPSL-1.0"
] | null | null | null | gala-spider/spider/service/__init__.py | seandong37tt4qu/jeszhengq | 32b3737ab45e89e8c5b71cdce871cefd2c938fa8 | [
"MulanPSL-1.0"
] | null | null | null | gala-spider/spider/service/__init__.py | seandong37tt4qu/jeszhengq | 32b3737ab45e89e8c5b71cdce871cefd2c938fa8 | [
"MulanPSL-1.0"
] | null | null | null | from .service import StorageService
from .service import DataCollectionService
from .service import CalculationService
| 29.75 | 42 | 0.87395 |
c8c3b064bc8d4176d426e65ea61faa6579250985 | 3,319 | py | Python | examples/scripts/csc/cbpdn_pgm_gry.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 217 | 2016-06-13T16:41:26.000Z | 2022-03-22T06:31:05.000Z | examples/scripts/csc/cbpdn_pgm_gry.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 21 | 2016-06-13T23:28:35.000Z | 2022-02-17T23:20:01.000Z | examples/scripts/csc/cbpdn_pgm_gry.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 47 | 2016-12-14T13:08:33.000Z | 2021-12-12T01:59:49.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the SPORCO package. Details of the copyright
# and user license can be found in the 'LICENSE.txt' file distributed
# with the package.
"""
PGM CBPDN Solver
==================
This example demonstrates the use of a PGM solver for a convolutional spar... | 25.335878 | 197 | 0.68846 |
c8c3c3ccc4c322b33da4295605c8dbaeb188a388 | 221 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/data/alt_format_350.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/alt_format_350.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/data/alt_format_350.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Auto-generated file, do not edit by hand. 350 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_350 = [NumberFormat(pattern='(\\d{4})(\\d{4})', format='\\1 \\2', leading_digits_pattern=['2'])]
| 44.2 | 114 | 0.687783 |
c8c3d1cdf090318cc4e5b5d3924055f9fe3b72e0 | 877 | py | Python | sdks/python/test/test_BillingPlan.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_BillingPlan.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_BillingPlan.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 21.925 | 81 | 0.703535 |
c8c3d449685f28e78f767aafb617c4bfc465febb | 2,779 | py | Python | emerald/database_operations.py | femmerling/EmeraldBox | 68f5776577f0c929ca1f5ba23f1dfe480f813037 | [
"MIT"
] | 17 | 2015-01-15T21:41:16.000Z | 2021-01-10T15:34:09.000Z | emerald/database_operations.py | femmerling/EmeraldBox | 68f5776577f0c929ca1f5ba23f1dfe480f813037 | [
"MIT"
] | null | null | null | emerald/database_operations.py | femmerling/EmeraldBox | 68f5776577f0c929ca1f5ba23f1dfe480f813037 | [
"MIT"
] | 5 | 2015-02-07T02:41:18.000Z | 2016-11-11T02:50:21.000Z | import imp
import os.path
from app import db
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
def db_create():
# This creates the new database.
db.create_all()
# If no repo existed, the creation will prepare for the first migration.... | 41.477612 | 144 | 0.77366 |
c8c3dafec6aaadb1c7c75c24cf37d5f0e314487a | 10,053 | py | Python | src/sardana/tango/pool/Controller.py | marc2332/sardana | 48dc9191baaa63f6c714d8c025e8f3f96548ad26 | [
"CC-BY-3.0"
] | 43 | 2016-11-25T15:21:23.000Z | 2021-08-20T06:09:40.000Z | src/sardana/tango/pool/Controller.py | marc2332/sardana | 48dc9191baaa63f6c714d8c025e8f3f96548ad26 | [
"CC-BY-3.0"
] | 1,263 | 2016-11-25T15:58:37.000Z | 2021-11-02T22:23:47.000Z | src/sardana/tango/pool/Controller.py | marc2332/sardana | 48dc9191baaa63f6c714d8c025e8f3f96548ad26 | [
"CC-BY-3.0"
] | 58 | 2016-11-21T11:33:55.000Z | 2021-09-01T06:21:21.000Z | #!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... | 33.51 | 85 | 0.608077 |
c8c3ea03d493aefc0397bbc468e8fd450a45e87e | 931 | py | Python | sdks/python/test/test_ErrorDownloadLink.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_ErrorDownloadLink.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_ErrorDownloadLink.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 23.275 | 93 | 0.72073 |
c8c3ea599539e80c119f93061942784404b21328 | 4,319 | py | Python | zerver/webhooks/wordpress/tests.py | gnprice/zulip | f29a1918f3cd3795f6ded3dc174472ef0fde3973 | [
"Apache-2.0"
] | null | null | null | zerver/webhooks/wordpress/tests.py | gnprice/zulip | f29a1918f3cd3795f6ded3dc174472ef0fde3973 | [
"Apache-2.0"
] | 6 | 2020-09-05T21:07:41.000Z | 2021-12-02T17:56:37.000Z | zerver/webhooks/wordpress/tests.py | gnprice/zulip | f29a1918f3cd3795f6ded3dc174472ef0fde3973 | [
"Apache-2.0"
] | 1 | 2021-01-07T23:27:52.000Z | 2021-01-07T23:27:52.000Z | # -*- coding: utf-8 -*-
from zerver.lib.test_classes import WebhookTestCase
from zerver.models import get_realm, get_user
class WordPressHookTests(WebhookTestCase):
STREAM_NAME = 'wordpress'
URL_TEMPLATE = "/api/v1/external/wordpress?api_key={api_key}&stream={stream}"
FIXTURE_DIR_NAME = 'wordpress'
de... | 46.44086 | 102 | 0.664506 |
c8c4145747bee0a1061eff3588ecbcc3559c0396 | 3,872 | py | Python | homeassistant/util/async_.py | stravinci/AIS-home-assistant | ead4dafd3f801ebeb32860bd34443ed24a4f4167 | [
"Apache-2.0"
] | null | null | null | homeassistant/util/async_.py | stravinci/AIS-home-assistant | ead4dafd3f801ebeb32860bd34443ed24a4f4167 | [
"Apache-2.0"
] | null | null | null | homeassistant/util/async_.py | stravinci/AIS-home-assistant | ead4dafd3f801ebeb32860bd34443ed24a4f4167 | [
"Apache-2.0"
] | null | null | null | """Asyncio backports for Python 3.6 compatibility."""
from asyncio import coroutines, ensure_future, get_running_loop
from asyncio.events import AbstractEventLoop
import concurrent.futures
import functools
import logging
import threading
from traceback import extract_stack
from typing import Any, Callable, Coroutine, T... | 30.730159 | 103 | 0.648244 |
c8c46febb06672a86e7b59d7a57740d29ab27296 | 12,928 | py | Python | webdataset/composable.py | OCRoArchive/webdataset | d616fe4eac6715c939d1511e6c9348319dc5e057 | [
"BSD-3-Clause"
] | 389 | 2019-08-07T17:09:17.000Z | 2021-05-16T14:05:03.000Z | webdataset/composable.py | OCRoArchive/webdataset | d616fe4eac6715c939d1511e6c9348319dc5e057 | [
"BSD-3-Clause"
] | 87 | 2021-05-17T01:56:25.000Z | 2022-03-29T16:58:50.000Z | webdataset/composable.py | OCRoArchive/webdataset | d616fe4eac6715c939d1511e6c9348319dc5e057 | [
"BSD-3-Clause"
] | 42 | 2021-05-20T16:44:22.000Z | 2022-03-26T09:15:59.000Z | #
# Copyright (c) 2017-2021 NVIDIA CORPORATION. All rights reserved.
# This file is part of the WebDataset library.
# See the LICENSE file for licensing terms (BSD-style).
#
"""Train PyTorch models directly from POSIX tar archive.
Code works locally or over HTTP connections.
"""
import itertools as itt
import os
im... | 36.212885 | 109 | 0.649288 |
c8c47ccb4d74e10c143038633ef5762102678f52 | 41,721 | py | Python | sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_batch_account_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_batch_account_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/batch/azure-mgmt-batch/azure/mgmt/batch/aio/operations/_batch_account_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 46.25388 | 426 | 0.673162 |
c8c49879b8caae6b8f0a1ec9127a9e0fbc7c35fa | 1,428 | py | Python | alipay/aop/api/domain/AlipayDataAiserviceCloudbusScheduletaskodQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayDataAiserviceCloudbusScheduletaskodQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayDataAiserviceCloudbusScheduletaskodQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayDataAiserviceCloudbusScheduletaskodQueryModel(object):
def __init__(self):
self._app_version = None
self._plan_id = None
@property
def app_version(self):
re... | 25.5 | 73 | 0.60084 |
c8c4b8532f2bcd35daf4942c30449ee26304dac7 | 24,127 | py | Python | tests/integration/test_tf_integration.py | SubhashishQPIT/strawberryfields | dae6ae8b1b3eb188fc2c874bd6c943bebf697ab9 | [
"Apache-2.0"
] | 646 | 2018-03-26T15:12:35.000Z | 2022-03-21T18:52:42.000Z | tests/integration/test_tf_integration.py | tonybruguier/strawberryfields | 298601e409528f22c6717c2d816ab68ae8bda1fa | [
"Apache-2.0"
] | 666 | 2018-03-27T20:21:27.000Z | 2022-03-25T18:35:33.000Z | tests/integration/test_tf_integration.py | tonybruguier/strawberryfields | 298601e409528f22c6717c2d816ab68ae8bda1fa | [
"Apache-2.0"
] | 182 | 2018-04-11T17:09:39.000Z | 2022-03-29T15:38:43.000Z | # Copyright 2019 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | 35.533137 | 103 | 0.606084 |
c8c4c6086859d75da5d5522cb34a1f999519b588 | 1,897 | py | Python | test_script.py | mikkokotila/pybo | ae921861e3e8c18856f19c59fc4c7da8f2126c1c | [
"Apache-2.0"
] | null | null | null | test_script.py | mikkokotila/pybo | ae921861e3e8c18856f19c59fc4c7da8f2126c1c | [
"Apache-2.0"
] | null | null | null | test_script.py | mikkokotila/pybo | ae921861e3e8c18856f19c59fc4c7da8f2126c1c | [
"Apache-2.0"
] | null | null | null | class ValidityError(Exception):
'''Raised when a validity check is not passed'''
from collections import Counter
import pybo as bo
# 1. PREPARATION
# 1.1. Initializing the tokenizer
tok = bo.BoTokenizer('POS')
# 1.2. Loading in text
input_str = '༄༅། །རྒྱ་གར་སྐད་དུ། བོ་དྷི་སཏྭ་ཙརྻ་ཨ་བ་ཏ་ར། བོད་སྐད་དུ། བྱང་ཆུབ་སེ... | 26.71831 | 311 | 0.625198 |
c8c519a8525a2ccd65511dcff7cfef19788b42f9 | 1,887 | py | Python | adel/python/adel/sampling.py | Humhu/percepto | 4a45cce7dd294a8ce0b962bb68cae5c2b48c3b7f | [
"AFL-3.0"
] | 1 | 2021-06-15T09:34:24.000Z | 2021-06-15T09:34:24.000Z | adel/python/adel/sampling.py | Humhu/percepto | 4a45cce7dd294a8ce0b962bb68cae5c2b48c3b7f | [
"AFL-3.0"
] | null | null | null | adel/python/adel/sampling.py | Humhu/percepto | 4a45cce7dd294a8ce0b962bb68cae5c2b48c3b7f | [
"AFL-3.0"
] | null | null | null | """Classes for stateful data stream sampling
"""
def create_sampler(mode, **kwargs):
"""Creates a specified sampler instance
"""
if mode == 'uniform':
return UniformSampler(**kwargs)
elif mode == 'contiguous':
return ContiguousSampler(**kwargs)
else:
raise ValueError('Unkno... | 25.5 | 75 | 0.576047 |
c8c51fe296f125b9d3ff5c7d17206fbe5a1e4bbb | 762 | py | Python | politicalplaces/migrations/0008_auto_20170317_1636.py | 20tab/django-political-map | ca43fd492e65450b063a67580978e9a8e86c7b08 | [
"MIT"
] | 9 | 2017-02-24T20:01:11.000Z | 2021-07-20T09:35:55.000Z | politicalplaces/migrations/0008_auto_20170317_1636.py | 20tab/django-political-map | ca43fd492e65450b063a67580978e9a8e86c7b08 | [
"MIT"
] | 9 | 2017-03-01T18:34:01.000Z | 2021-06-01T22:01:23.000Z | politicalplaces/migrations/0008_auto_20170317_1636.py | 20tab/django-political-map | ca43fd492e65450b063a67580978e9a8e86c7b08 | [
"MIT"
] | 4 | 2017-03-01T10:29:46.000Z | 2019-09-29T01:31:22.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-17 16:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('politicalplaces', '0007_auto_20170315_1728'),
]
operations = [
migrations.R... | 25.4 | 63 | 0.599738 |
c8c529fb62c9cd1ace45b6a91f8fd74666ed4d63 | 9,433 | py | Python | syft/workers/websocket_client.py | Ankit-Dhankhar/PySyft | 750bd2c3987a570ef1dc8554b933696d416724c7 | [
"Apache-2.0"
] | null | null | null | syft/workers/websocket_client.py | Ankit-Dhankhar/PySyft | 750bd2c3987a570ef1dc8554b933696d416724c7 | [
"Apache-2.0"
] | null | null | null | syft/workers/websocket_client.py | Ankit-Dhankhar/PySyft | 750bd2c3987a570ef1dc8554b933696d416724c7 | [
"Apache-2.0"
] | 1 | 2021-04-18T15:27:15.000Z | 2021-04-18T15:27:15.000Z | import binascii
from typing import Union
from typing import List
import torch
import websocket
import websockets
import logging
import ssl
import time
import syft as sy
from syft import messaging
from syft.generic.tensor import AbstractTensor
from syft.workers import BaseWorker
logger = logging.getLogger(__name__)
... | 38.190283 | 100 | 0.650588 |
c8c52a40e287291d1172b774243d9b7674a3f0d1 | 1,370 | py | Python | dpa/data/plugins/nuke/menu.py | Clemson-DPA/dpa-pipe | 2482b8a0fd96dc19c0be4e82c3eaf0508914a968 | [
"MIT"
] | 55 | 2015-07-15T02:33:55.000Z | 2020-12-28T08:02:54.000Z | dpa/data/plugins/nuke/menu.py | Clemson-DPA/dpa-pipe | 2482b8a0fd96dc19c0be4e82c3eaf0508914a968 | [
"MIT"
] | 5 | 2015-07-11T03:21:10.000Z | 2016-12-27T12:20:07.000Z | dpa/data/plugins/nuke/menu.py | Clemson-DPA/dpa-pipe | 2482b8a0fd96dc19c0be4e82c3eaf0508914a968 | [
"MIT"
] | 12 | 2015-07-08T04:48:39.000Z | 2020-06-27T11:35:58.000Z |
import nuke
from dpa.ptask.area import PTaskArea
from dpa.ui.icon.factory import IconFactory
from dpa.nuke.nodes import add_commands, on_load
# -----------------------------------------------------------------------------
NUKE_TOOLBAR_CONFIG = 'config/nuke/toolbars.cfg'
# -----------------------------------------... | 30.444444 | 79 | 0.560584 |
c8c549b238ba10261e7022733a35ac01333214d7 | 2,077 | py | Python | src/dataverk/connectors/storage/nais.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 3 | 2019-09-29T20:48:46.000Z | 2021-03-31T10:16:07.000Z | src/dataverk/connectors/storage/nais.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 148 | 2019-02-08T12:30:58.000Z | 2021-03-11T15:31:55.000Z | src/dataverk/connectors/storage/nais.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 1 | 2020-11-18T14:10:05.000Z | 2020-11-18T14:10:05.000Z | import requests
from dataverk.connectors.storage.bucket_storage_base import BucketStorageBase
class NaisS3Connector(BucketStorageBase):
"""
Connector for NAIS S3 API
"""
def __init__(self, bucket_name: str, s3_endpoint: str):
super().__init__()
self._bucket_name = bucket_name
... | 38.462963 | 107 | 0.602792 |
c8c55870e0ff29aa071829663b9660b228d72aba | 2,720 | py | Python | homeassistant/components/http/static.py | mbs-technologie/home-assistant | 71fc446425cbb1c0d4670c261ce8ea3bfd83a73d | [
"MIT"
] | 9 | 2017-04-16T20:40:08.000Z | 2021-12-03T07:11:11.000Z | homeassistant/components/http/static.py | mbs-technologie/home-assistant | 71fc446425cbb1c0d4670c261ce8ea3bfd83a73d | [
"MIT"
] | null | null | null | homeassistant/components/http/static.py | mbs-technologie/home-assistant | 71fc446425cbb1c0d4670c261ce8ea3bfd83a73d | [
"MIT"
] | 2 | 2017-12-26T06:00:15.000Z | 2019-06-18T00:14:20.000Z | """Static file handling for HTTP component."""
import asyncio
import mimetypes
import re
from aiohttp import hdrs
from aiohttp.file_sender import FileSender
from aiohttp.web_urldispatcher import StaticResource
from aiohttp.web_exceptions import HTTPNotModified
from .const import KEY_DEVELOPMENT
_FINGERPRINT = re.com... | 28.93617 | 75 | 0.65 |
c8c573360a2e9438c149f762940076a3d0fd4e61 | 2,491 | py | Python | homesensing_app_project/homesensing/models/__init__.py | matteoferla/Somewhat-Smart-Home | aa3b3855648b1732c733e8cc604ab2f0124d12c4 | [
"MIT"
] | null | null | null | homesensing_app_project/homesensing/models/__init__.py | matteoferla/Somewhat-Smart-Home | aa3b3855648b1732c733e8cc604ab2f0124d12c4 | [
"MIT"
] | null | null | null | homesensing_app_project/homesensing/models/__init__.py | matteoferla/Somewhat-Smart-Home | aa3b3855648b1732c733e8cc604ab2f0124d12c4 | [
"MIT"
] | null | null | null | from sqlalchemy import engine_from_config
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm import configure_mappers
import zope.sqlalchemy
# import or define all models here to ensure they are attached to the
# Base.metadata prior to any initialization routines
from .sunpath import Sunpath
from .measurement... | 30.753086 | 83 | 0.738659 |
c8c58311a999ce4052082b9380a8f1378d69741c | 1,537 | py | Python | fbchat/__init__.py | adbenitez/fbchat | 8052b818de5de9682f6d64405579ad640cd657ee | [
"BSD-3-Clause"
] | 1 | 2020-08-06T00:51:25.000Z | 2020-08-06T00:51:25.000Z | fbchat/__init__.py | adbenitez/fbchat | 8052b818de5de9682f6d64405579ad640cd657ee | [
"BSD-3-Clause"
] | null | null | null | fbchat/__init__.py | adbenitez/fbchat | 8052b818de5de9682f6d64405579ad640cd657ee | [
"BSD-3-Clause"
] | null | null | null | """Facebook Chat (Messenger) for Python
:copyright: (c) 2015 - 2019 by Taehoon Kim
:license: BSD 3-Clause, see LICENSE for more details.
"""
import logging as _logging
# Set default logging handler to avoid "No handler found" warnings.
_logging.getLogger(__name__).addHandler(_logging.NullHandler())
# The order of t... | 32.702128 | 88 | 0.788549 |
c8c58bb67b2d02a324305fe2b1f9e05fdf8597d3 | 309 | py | Python | LC/521.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | 2 | 2018-02-24T17:20:02.000Z | 2018-02-24T17:25:43.000Z | LC/521.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | LC/521.py | szhu3210/LeetCode_Solutions | 64747eb172c2ecb3c889830246f3282669516e10 | [
"MIT"
] | null | null | null | class Solution(object):
def findLUSlength(self, a, b):
"""
:type a: str
:type b: str
:rtype: int
"""
la = len(a)
lb = len(b)
if la!=lb:
return max(la, lb)
if a!=b:
return la
else:
return -1 | 20.6 | 34 | 0.385113 |
c8c5a9a4bffd71d21f64450177a629fb9a139a84 | 5,674 | py | Python | tests/test_table.py | ZoomerAnalytics/xlwings | bc6846785d29d6511beff29e536b937ec0e5a57b | [
"BSD-3-Clause"
] | 1,138 | 2015-01-02T23:04:18.000Z | 2019-04-02T09:04:09.000Z | tests/test_table.py | ZoomerAnalytics/xlwings | bc6846785d29d6511beff29e536b937ec0e5a57b | [
"BSD-3-Clause"
] | 872 | 2015-01-02T01:43:52.000Z | 2019-04-02T20:30:10.000Z | tests/test_table.py | ZoomerAnalytics/xlwings | bc6846785d29d6511beff29e536b937ec0e5a57b | [
"BSD-3-Clause"
] | 261 | 2015-01-13T17:34:07.000Z | 2019-03-20T17:33:36.000Z | import unittest
from pathlib import Path
import xlwings as xw
import pandas as pd
class TestTable(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.book = xw.Book()
cls.sheet = cls.book.sheets[0]
cls.sheet["A1"].value = [["a", "b"], [1, 2]]
cls.test_table = cls.sheet.t... | 39.402778 | 88 | 0.688579 |
c8c5ba7f2e31a9ced8f32a5a265651f85f6787ff | 30,370 | py | Python | airflow/sensors/smart_sensor.py | kevin0120/airflow | fa263cbf0ac002bdb26239ce36d5dc2a1b6251fd | [
"Apache-2.0"
] | 1 | 2021-03-03T07:00:02.000Z | 2021-03-03T07:00:02.000Z | airflow/sensors/smart_sensor.py | kevin0120/airflow | fa263cbf0ac002bdb26239ce36d5dc2a1b6251fd | [
"Apache-2.0"
] | 36 | 2021-11-26T00:08:49.000Z | 2021-11-26T00:09:33.000Z | airflow/sensors/smart_sensor.py | kevin0120/airflow | fa263cbf0ac002bdb26239ce36d5dc2a1b6251fd | [
"Apache-2.0"
] | 3 | 2020-06-30T02:38:17.000Z | 2022-01-19T06:14:08.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 39.492848 | 110 | 0.635858 |
c8c5ea3f0d8b8556e5a775d2964fdbb51041f71e | 406 | py | Python | dasak/dashboard_prep.py | gino-serpa/Data-Swiss-Army-Knife | 03e39636861bfbb5eeb1629c7201bf15852a88ef | [
"MIT"
] | null | null | null | dasak/dashboard_prep.py | gino-serpa/Data-Swiss-Army-Knife | 03e39636861bfbb5eeb1629c7201bf15852a88ef | [
"MIT"
] | null | null | null | dasak/dashboard_prep.py | gino-serpa/Data-Swiss-Army-Knife | 03e39636861bfbb5eeb1629c7201bf15852a88ef | [
"MIT"
] | null | null | null | '''
dashboard preparation code
'''
import ingest_scielo
import pickle
import networkx as nx
df = ingest_scielo.ingest_wos_scielo_folder()
authors, papers, institutions = ingest_scielo.get_scielo_dicts(df)
data_dict = {'authors_dict':authors,
'papers_dict':papers,
'institutions_dict':institut... | 23.882353 | 66 | 0.746305 |
c8c5fc4d49938107c142e6fdb2e2a52cd7e0549c | 48,214 | py | Python | homeassistant/core.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 1 | 2021-09-29T20:33:32.000Z | 2021-09-29T20:33:32.000Z | homeassistant/core.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 3 | 2021-09-08T03:31:36.000Z | 2022-03-12T01:00:03.000Z | homeassistant/core.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """
Core components of Home Assistant.
Home Assistant is a Home Automation framework for observing the state
of entities and react to changes.
"""
import asyncio
from concurrent.futures import ThreadPoolExecutor
import datetime
import enum
import functools
import logging
import os
import pathlib
import re
import threa... | 32.142667 | 101 | 0.613038 |
c8c60414ddf66c90a1a6445591243174b368016a | 2,282 | py | Python | src/users/serializers.py | sjdines/bullet-train-api | 1d5f0dd905025901bc085d7d49982d2ebb2b89c6 | [
"BSD-3-Clause"
] | 1 | 2022-03-26T08:27:55.000Z | 2022-03-26T08:27:55.000Z | src/users/serializers.py | sjdines/bullet-train-api | 1d5f0dd905025901bc085d7d49982d2ebb2b89c6 | [
"BSD-3-Clause"
] | null | null | null | src/users/serializers.py | sjdines/bullet-train-api | 1d5f0dd905025901bc085d7d49982d2ebb2b89c6 | [
"BSD-3-Clause"
] | null | null | null | from allauth.account.adapter import get_adapter
from allauth.account.utils import setup_user_email
from rest_auth.registration.serializers import RegisterSerializer
from rest_framework import serializers
from django.utils.translation import ugettext_lazy as _
from organisations.serializers import OrganisationSerializ... | 33.072464 | 77 | 0.677914 |
c8c60b77ca8c3c393c62c602747abd279df25f5f | 8,924 | py | Python | bot.py | dinomask/Angels_Mortals_bot | d97417e097f12d6375f35d472b8813c7754b1f01 | [
"MIT"
] | null | null | null | bot.py | dinomask/Angels_Mortals_bot | d97417e097f12d6375f35d472b8813c7754b1f01 | [
"MIT"
] | null | null | null | bot.py | dinomask/Angels_Mortals_bot | d97417e097f12d6375f35d472b8813c7754b1f01 | [
"MIT"
] | 1 | 2022-01-04T10:57:29.000Z | 2022-01-04T10:57:29.000Z | '''
Use this bot only if you want to run 1 bot for private messaging!
'''
import logging
import player
import messages
import datetime
import collections
import config
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup, ReplyKeyboardRemove
from telegram.ext import Updater, CommandHandler, Messag... | 35.553785 | 182 | 0.705513 |
c8c62a522293573703dae0bb21e9b17bd59f768e | 4,195 | py | Python | python/oneflow/nn/modules/sparse.py | Warmchay/oneflow | 5a333ff065bb89990318de2f1bd650e314d49301 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/modules/sparse.py | Warmchay/oneflow | 5a333ff065bb89990318de2f1bd650e314d49301 | [
"Apache-2.0"
] | null | null | null | python/oneflow/nn/modules/sparse.py | Warmchay/oneflow | 5a333ff065bb89990318de2f1bd650e314d49301 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 38.136364 | 122 | 0.631704 |
c8c62ff48d9f404c8e2a4732f808bb426e530518 | 3,535 | py | Python | trac/upgrades/db28.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | trac/upgrades/db28.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | trac/upgrades/db28.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2020 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://trac.edgewall.org/wiki/TracLicense.
#
# This software cons... | 38.423913 | 78 | 0.66082 |
c8c65bb1af71957be0d82c9ad2d3fd425de55afd | 6,610 | py | Python | credoscript/models/pigroup.py | tlb-lab/credoscript | 32bdf08d84703dc2062dae4df1a95587d36c3cf7 | [
"MIT"
] | null | null | null | credoscript/models/pigroup.py | tlb-lab/credoscript | 32bdf08d84703dc2062dae4df1a95587d36c3cf7 | [
"MIT"
] | null | null | null | credoscript/models/pigroup.py | tlb-lab/credoscript | 32bdf08d84703dc2062dae4df1a95587d36c3cf7 | [
"MIT"
] | null | null | null | from itertools import groupby
from sqlalchemy.orm import backref, relationship, column_property
from sqlalchemy.sql.expression import and_, func, or_
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.hybrid import hybrid_property
from credoscript import Base, BaseQuery, schema, pi_grou... | 38.882353 | 122 | 0.593192 |
c8c699442ef938380cd55061a7f2b38a04ca3453 | 865 | py | Python | simplemachine/emulator.py | GuyGoldenberg/simple-machine-emulator | 727e140265343aca72f2fd5858bb9b9e9a507e7c | [
"MIT"
] | 2 | 2018-06-08T12:32:31.000Z | 2019-03-01T14:03:06.000Z | simplemachine/emulator.py | GuyGoldenberg/simple-machine-emulator | 727e140265343aca72f2fd5858bb9b9e9a507e7c | [
"MIT"
] | null | null | null | simplemachine/emulator.py | GuyGoldenberg/simple-machine-emulator | 727e140265343aca72f2fd5858bb9b9e9a507e7c | [
"MIT"
] | null | null | null | from utils.exceptions import EmulatorException
from memory import memory
from processor import cpu
class Emulator(object):
"""
This class is used to manage the entire emulation process.
It is practically a wrapper which joins the CPU and the memory to a unified data structure
"""
def __init__(se... | 26.212121 | 94 | 0.633526 |
c8c69c3688e1a6e039c9e2e9f7ea401fc4c1de7f | 598 | py | Python | workalendar/usa/montana.py | vanadium23/workalendar | 4c67b5a7900fa56d7a93b767c6cbd8f1cc6b70a7 | [
"MIT"
] | null | null | null | workalendar/usa/montana.py | vanadium23/workalendar | 4c67b5a7900fa56d7a93b767c6cbd8f1cc6b70a7 | [
"MIT"
] | null | null | null | workalendar/usa/montana.py | vanadium23/workalendar | 4c67b5a7900fa56d7a93b767c6cbd8f1cc6b70a7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import warnings
from .core import UnitedStates
class Montana(UnitedStates):
"""Montana"""
include_election_day_even = True
def get_variable_days(self, year):
warnin... | 31.473684 | 76 | 0.653846 |
c8c6b0f9c4175e18df83e06be2ff2bf07e7621eb | 154 | py | Python | project/hello/urls.py | ccsr/sample-django-docker | 5d202b0f858e396467ffc04227bf691b3f420902 | [
"MIT"
] | 49 | 2019-04-11T06:34:52.000Z | 2022-03-28T14:14:37.000Z | project/hello/urls.py | ccsr/sample-django-docker | 5d202b0f858e396467ffc04227bf691b3f420902 | [
"MIT"
] | null | null | null | project/hello/urls.py | ccsr/sample-django-docker | 5d202b0f858e396467ffc04227bf691b3f420902 | [
"MIT"
] | 11 | 2019-04-14T10:50:08.000Z | 2022-02-28T18:33:11.000Z | from django.urls import path
from . import views
urlpatterns = [
path(
"",
views.HelloView.as_view(),
name="home",
),
]
| 12.833333 | 34 | 0.538961 |
c8c6c57d0538059186e10d5b56b168ed0ebad03d | 3,480 | py | Python | python/tvm/contrib/clang.py | mingwayzhang/tvm | 3b287c4d4e6d83e6fd30db47ffa3d5481a332a63 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | python/tvm/contrib/clang.py | mingwayzhang/tvm | 3b287c4d4e6d83e6fd30db47ffa3d5481a332a63 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | python/tvm/contrib/clang.py | mingwayzhang/tvm | 3b287c4d4e6d83e6fd30db47ffa3d5481a332a63 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 30 | 65 | 0.635057 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.