hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72f90fd5e586ab49bbf8330d152dd3b15c6712f | 2,341 | py | Python | app/lib/models.py | simonlevine/x-transformer-icd | 17d0a84f8b8e1f69623a82c0afab26830c7a1eb8 | [
"BSD-3-Clause"
] | 1 | 2020-12-15T00:55:25.000Z | 2020-12-15T00:55:25.000Z | app/lib/models.py | simonlevine/x-transformer-icd | 17d0a84f8b8e1f69623a82c0afab26830c7a1eb8 | [
"BSD-3-Clause"
] | null | null | null | app/lib/models.py | simonlevine/x-transformer-icd | 17d0a84f8b8e1f69623a82c0afab26830c7a1eb8 | [
"BSD-3-Clause"
] | null | null | null | """deserialize auto-icd models and provide a consistent interface"""
import typing as t
import json
import pickle
from pathlib import Path
import numpy as np
import onnxruntime as rt
APP_ROOT = Path("./app")
ASSETS_DIR = APP_ROOT/"assets"
class AutoICDModel:
def __init__(self, onnx_model_fp):
assert on... | 34.940299 | 85 | 0.656557 |
import typing as t
import json
import pickle
from pathlib import Path
import numpy as np
import onnxruntime as rt
APP_ROOT = Path("./app")
ASSETS_DIR = APP_ROOT/"assets"
class AutoICDModel:
def __init__(self, onnx_model_fp):
assert onnx_model_fp.exists()
self.sess = rt.InferenceSession(str(onnx... | true | true |
f72f9151e8655b5897d9a3dbddc1abcb2e46e0c6 | 1,689 | py | Python | app.py | Catlinman/catlinman.com | 9a94b8491975cf589b9cd53262a54fa56b7a0555 | [
"MIT"
] | 2 | 2017-07-04T11:51:30.000Z | 2019-10-07T08:04:12.000Z | app.py | Catlinman/catlinman.com | 9a94b8491975cf589b9cd53262a54fa56b7a0555 | [
"MIT"
] | null | null | null | app.py | Catlinman/catlinman.com | 9a94b8491975cf589b9cd53262a54fa56b7a0555 | [
"MIT"
] | 2 | 2020-09-29T06:56:07.000Z | 2020-10-02T21:49:31.000Z |
# Import Python modules.
import sys
# Import application modules.
import assets
import database
import blueprints
# Import basic Sanic modules.
from sanic import Sanic
# Get the required Jinja2 module for rendering templates.
import jinja2 as j2
# Enabling async template execution which allows you to take advantag... | 25.590909 | 79 | 0.748372 |
import sys
import assets
import database
import blueprints
from sanic import Sanic
import jinja2 as j2
enable_async = sys.version_info >= (3, 6)
app = Sanic(name="catlinman.com", register=False)
app.static("/static", "./static")
template_env = j2.Environment(
loader=j2.PackageLoader("app", "templates"),
... | true | true |
f72f91b9b9f83a577df103957548819b165bf8d5 | 16,826 | py | Python | pychron/hardware/core/communicators/serial_communicator.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | null | null | null | pychron/hardware/core/communicators/serial_communicator.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 80 | 2018-07-17T20:10:20.000Z | 2021-08-17T15:38:24.000Z | pychron/hardware/core/communicators/serial_communicator.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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... | 31.927894 | 103 | 0.524664 |
import codecs
import glob
import os
import sys
import time
import serial
from .communicator import Communicator, process_response, prep_str, remove_eol_func
def get_ports():
if sys.platform == 'win32':
ports = ['COM{}'.format(i+1) for i in range(256)]
else:
usb = glob.glob('/dev/tty.usb*')... | true | true |
f72f91d02075c3865e71042a4c4631a5ce5c09f9 | 6,749 | py | Python | lfs/manage/views/marketing/featured.py | michael-hahn/django-lfs | 26c3471a8f8d88269c84f714f507b952dfdb6397 | [
"BSD-3-Clause"
] | 345 | 2015-01-03T19:19:27.000Z | 2022-03-20T11:00:50.000Z | lfs/manage/views/marketing/featured.py | michael-hahn/django-lfs | 26c3471a8f8d88269c84f714f507b952dfdb6397 | [
"BSD-3-Clause"
] | 73 | 2015-01-06T14:54:02.000Z | 2022-03-11T23:11:34.000Z | lfs/manage/views/marketing/featured.py | michael-hahn/django-lfs | 26c3471a8f8d88269c84f714f507b952dfdb6397 | [
"BSD-3-Clause"
] | 148 | 2015-01-07T16:30:08.000Z | 2022-03-25T21:20:58.000Z | import json
from django.contrib.auth.decorators import permission_required
from django.core.paginator import EmptyPage
from django.core.paginator import Paginator
from django.db.models import Q
from django.http import HttpResponse
from django.template.loader import render_to_string
from django.utils.translation import... | 33.577114 | 108 | 0.645281 | import json
from django.contrib.auth.decorators import permission_required
from django.core.paginator import EmptyPage
from django.core.paginator import Paginator
from django.db.models import Q
from django.http import HttpResponse
from django.template.loader import render_to_string
from django.utils.translation import... | true | true |
f72f92bc7ae99fd0568a2619f8d80e2d1390372f | 2,592 | py | Python | update.py | CyberHive/bucket-antivirus-function | bb5f91678cc85d08bfc42108edc399be5c5fc4b6 | [
"Apache-2.0"
] | null | null | null | update.py | CyberHive/bucket-antivirus-function | bb5f91678cc85d08bfc42108edc399be5c5fc4b6 | [
"Apache-2.0"
] | null | null | null | update.py | CyberHive/bucket-antivirus-function | bb5f91678cc85d08bfc42108edc399be5c5fc4b6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Upside Travel, 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 agreed to... | 39.272727 | 87 | 0.717978 |
import os
import boto3
import clamav
from common import AV_DEFINITION_PATH
from common import AV_DEFINITION_S3_BUCKET
from common import AV_DEFINITION_S3_PREFIX
from common import CLAMAVLIB_PATH
from common import get_timestamp
import shutil
def lambda_handler(event, context):
s3_client = boto3.client("s3"... | true | true |
f72f92c99cf839ad598a33d59f04bbdac9db7a62 | 867 | py | Python | src/tensra/nn.py | poghostick/tensra | d171fd7483b3a61e36e133c95abfb78a9395297d | [
"MIT"
] | null | null | null | src/tensra/nn.py | poghostick/tensra | d171fd7483b3a61e36e133c95abfb78a9395297d | [
"MIT"
] | null | null | null | src/tensra/nn.py | poghostick/tensra | d171fd7483b3a61e36e133c95abfb78a9395297d | [
"MIT"
] | null | null | null | """
A NeuralNet is just a collection of layers.
It behaves a lot like a layer itself, although
we're not going to make it one.
"""
from typing import Sequence, Iterator, Tuple
from .tensor import Tensor
from .layers import Layer
class NeuralNet:
def __init__(self, layers: Sequence[Layer]) -> None:
self.l... | 27.967742 | 66 | 0.635525 | from typing import Sequence, Iterator, Tuple
from .tensor import Tensor
from .layers import Layer
class NeuralNet:
def __init__(self, layers: Sequence[Layer]) -> None:
self.layers = layers
def forward(self, inputs: Tensor) -> Tensor:
for layer in self.layers:
inputs = layer.forwa... | true | true |
f72f93203fa30524663dd1ad94aabbba9deee380 | 5,466 | py | Python | talos/templates/models.py | bjtho08/talos | dbd27b46a019f6fbfb7b7f08b2eb0de3be0a41ad | [
"MIT"
] | 1 | 2020-11-08T03:12:22.000Z | 2020-11-08T03:12:22.000Z | talos/templates/models.py | bjtho08/talos | dbd27b46a019f6fbfb7b7f08b2eb0de3be0a41ad | [
"MIT"
] | null | null | null | talos/templates/models.py | bjtho08/talos | dbd27b46a019f6fbfb7b7f08b2eb0de3be0a41ad | [
"MIT"
] | null | null | null | def breast_cancer(x_train, y_train, x_val, y_val, params):
from keras.models import Sequential
from keras.layers import Dropout, Dense
from talos.model import lr_normalizer, early_stopper, hidden_layers
from talos.metrics.keras_metrics import matthews, precision, recall, f1score
model = Sequentia... | 35.72549 | 80 | 0.551409 | def breast_cancer(x_train, y_train, x_val, y_val, params):
from keras.models import Sequential
from keras.layers import Dropout, Dense
from talos.model import lr_normalizer, early_stopper, hidden_layers
from talos.metrics.keras_metrics import matthews, precision, recall, f1score
model = Sequentia... | true | true |
f72f940275710e56f5500dcf7f4aacb8959a82b9 | 2,593 | py | Python | tensorflow_probability/python/bijectors/sigmoid_test.py | matthieucoquet/probability | 2426f4fc4743ceedc1a638a03d19ce6654ebff76 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/bijectors/sigmoid_test.py | matthieucoquet/probability | 2426f4fc4743ceedc1a638a03d19ce6654ebff76 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/bijectors/sigmoid_test.py | matthieucoquet/probability | 2426f4fc4743ceedc1a638a03d19ce6654ebff76 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# 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 o... | 37.042857 | 115 | 0.69302 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from scipy import special
import tensorflow.compat.v2 as tf
from tensorflow_probability.python import bijectors as tfb
from tensorflow_probability.python.bijectors import bijector_test_util... | true | true |
f72f9494e109e2041d0b65a04cdffcdfc754e555 | 127 | py | Python | pysparkrpc/server/__init__.py | abronte/PysparkAPI | 894f9a550109b7d3fc10573fb1f080972ed13d8d | [
"MIT"
] | 1 | 2020-07-31T17:50:50.000Z | 2020-07-31T17:50:50.000Z | pysparkrpc/server/__init__.py | abronte/PysparkAPI | 894f9a550109b7d3fc10573fb1f080972ed13d8d | [
"MIT"
] | 3 | 2021-06-06T18:25:43.000Z | 2021-06-07T00:26:44.000Z | pysparkrpc/server/__init__.py | abronte/PysparkAPI | 894f9a550109b7d3fc10573fb1f080972ed13d8d | [
"MIT"
] | null | null | null | from pysparkrpc.server.server import run
from pysparkrpc.server.capture import Capture
__all__ = [
'run', 'Capture'
]
| 18.142857 | 45 | 0.724409 | from pysparkrpc.server.server import run
from pysparkrpc.server.capture import Capture
__all__ = [
'run', 'Capture'
]
| true | true |
f72f94e64373f2e4a2564243a8a3d17883885b79 | 2,599 | py | Python | tests/test_unit/test_ga4gh/test_testbed/test_report/test_summary.py | alextsaihi/ga4gh-testbed-lib | ad1cb6ea2bac85ae81ce75dfbbb74ef3f9dc1252 | [
"Apache-2.0"
] | null | null | null | tests/test_unit/test_ga4gh/test_testbed/test_report/test_summary.py | alextsaihi/ga4gh-testbed-lib | ad1cb6ea2bac85ae81ce75dfbbb74ef3f9dc1252 | [
"Apache-2.0"
] | 3 | 2022-03-21T18:30:27.000Z | 2022-03-30T18:04:05.000Z | tests/test_unit/test_ga4gh/test_testbed/test_report/test_summary.py | alextsaihi/ga4gh-testbed-lib | ad1cb6ea2bac85ae81ce75dfbbb74ef3f9dc1252 | [
"Apache-2.0"
] | null | null | null | import pytest
from ga4gh.testbed.report.summary import Summary
increment_inputs = "count_type," \
+ "use_n," \
+ "n,"
increment_cases = [
("unknown", False, 1),
("unknown", True, 3),
("passed", False, 1),
("passed", True, 4),
("warned", False, 1),
("warned", True, 5),
("failed", Fal... | 28.877778 | 76 | 0.652943 | import pytest
from ga4gh.testbed.report.summary import Summary
increment_inputs = "count_type," \
+ "use_n," \
+ "n,"
increment_cases = [
("unknown", False, 1),
("unknown", True, 3),
("passed", False, 1),
("passed", True, 4),
("warned", False, 1),
("warned", True, 5),
("failed", Fal... | true | true |
f72f950331335ccf80a3f395f9946878cbb3df84 | 1,153 | py | Python | plotfunction.py | kayaei/pands-problem-set | a7c48059e3024955794c67d9e6f969a42f4e3a6d | [
"Apache-2.0"
] | null | null | null | plotfunction.py | kayaei/pands-problem-set | a7c48059e3024955794c67d9e6f969a42f4e3a6d | [
"Apache-2.0"
] | null | null | null | plotfunction.py | kayaei/pands-problem-set | a7c48059e3024955794c67d9e6f969a42f4e3a6d | [
"Apache-2.0"
] | null | null | null | # Etem Kaya 16-Mar-2019
# Solution to Problem-10.
# File name: "plotfunction.py".
# Problem-10: Write a program that displays a plot of the functions x, x2 & 2x
# in the range [0, 4].
#Import matplotlib and numpy packages
import matplotlib.pyplot as plt
import numpy as np
# setup the lenght and scale of the x axis... | 25.622222 | 78 | 0.656548 |
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0.0, 4.0, 0.5)
y1 = x y2 = x**2 y3 = 2**x
plt.plot(x, y1)
plt.plot(x, y2)
plt.plot(x, y3)
plt.plot(1, 1, 'or')
plt.plot(2, 4, 'bo')
plt.title('Plotting Graph for functions f(x), f(x^2) and f(2^x)')
plt.xlabel('X - Axis')
plt.ylab... | true | true |
f72f95655316cae4f59823e2c006bc6e12d8d83d | 6,245 | py | Python | ID09/run_wofry_polychromatic_partial_coherence.py | srio/shadow3-scripts | 10712641333c29ca9854e9cc60d86cb321f3762b | [
"MIT"
] | 1 | 2019-10-30T10:06:15.000Z | 2019-10-30T10:06:15.000Z | ID09/run_wofry_polychromatic_partial_coherence.py | srio/shadow3-scripts | 10712641333c29ca9854e9cc60d86cb321f3762b | [
"MIT"
] | null | null | null | ID09/run_wofry_polychromatic_partial_coherence.py | srio/shadow3-scripts | 10712641333c29ca9854e9cc60d86cb321f3762b | [
"MIT"
] | null | null | null |
#
# Import section
#
import numpy
from syned.beamline.beamline_element import BeamlineElement
from syned.beamline.element_coordinates import ElementCoordinates
from wofry.propagator.propagator import PropagationManager, PropagationElements, PropagationParameters
from wofry.propagator.wavefront1D.generic_wavefront ... | 32.696335 | 120 | 0.689512 |
import numpy
from syned.beamline.beamline_element import BeamlineElement
from syned.beamline.element_coordinates import ElementCoordinates
from wofry.propagator.propagator import PropagationManager, PropagationElements, PropagationParameters
from wofry.propagator.wavefront1D.generic_wavefront import GenericWavefro... | true | true |
f72f95ac268fc32ff366dbf8047445bc5328d793 | 3,775 | py | Python | myblog_project/settings.py | KevinPercy/myprofilerestapi | 88738997eec99982ca6774de2ffb5daaa640c26c | [
"MIT"
] | null | null | null | myblog_project/settings.py | KevinPercy/myprofilerestapi | 88738997eec99982ca6774de2ffb5daaa640c26c | [
"MIT"
] | 6 | 2021-03-19T07:57:21.000Z | 2021-09-22T19:14:19.000Z | myblog_project/settings.py | KevinPercy/myprofilerestapi | 88738997eec99982ca6774de2ffb5daaa640c26c | [
"MIT"
] | null | null | null | """
Django settings for myblog_project project.
Generated by 'django-admin startproject' using Django 3.0.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
impor... | 25.33557 | 91 | 0.692715 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'n$b=m%w%ynh82g66$o67=+t&a1n&r19%aggblv#f0nxw&2i_%e'
DEBUG = bool(int(os.environ.get('DEBUG', 1)))
# DEBUG = True
ALLOWED_HOSTS = [
'ec2-3-22-55-28.us-east-2.compute.amazonaws.com',
'3.22.55.28',
'api.kevinc... | true | true |
f72f97f7bd6a90c32e6a928e7162e7ae0f2fb559 | 2,394 | py | Python | toascii/CLI.py | Sh-wayz/to-ascii | b54bd9f68c7449982fbef6a0dad7e41e8d2d136e | [
"MIT"
] | 1 | 2020-10-20T19:09:27.000Z | 2020-10-20T19:09:27.000Z | toascii/CLI.py | Sh-wayz/to-ascii | b54bd9f68c7449982fbef6a0dad7e41e8d2d136e | [
"MIT"
] | null | null | null | toascii/CLI.py | Sh-wayz/to-ascii | b54bd9f68c7449982fbef6a0dad7e41e8d2d136e | [
"MIT"
] | null | null | null |
def main():
import argparse
from .Image import Image
from .Video import Video
from .Live import Live
parser = argparse.ArgumentParser(
prog='to-ascii',
description='A tool which can convert videos, images, gifs, and even live video to ascii art!'
)
# cli args
parser.a... | 38.612903 | 161 | 0.631161 |
def main():
import argparse
from .Image import Image
from .Video import Video
from .Live import Live
parser = argparse.ArgumentParser(
prog='to-ascii',
description='A tool which can convert videos, images, gifs, and even live video to ascii art!'
)
parser.add_argument... | true | true |
f72f99ed631de8235fb5965c7d3a5d3202831bf1 | 1,133 | py | Python | mongotopy.py | LaudateCorpus1/mongotopy | 50d51caa3928ce51dca2f77793a316c7e5049769 | [
"MIT"
] | null | null | null | mongotopy.py | LaudateCorpus1/mongotopy | 50d51caa3928ce51dca2f77793a316c7e5049769 | [
"MIT"
] | null | null | null | mongotopy.py | LaudateCorpus1/mongotopy | 50d51caa3928ce51dca2f77793a316c7e5049769 | [
"MIT"
] | 1 | 2022-01-29T07:48:26.000Z | 2022-01-29T07:48:26.000Z | #! /usr/bin/env python3
import os
import subprocess
import json
import sys
import time
seconds = '60'
prefix = "/var/tmp"
filename = "mongotopy.json"
def reformat(data):
formatted = []
data = data['totals']
for dbcoll in data:
database, coll = dbcoll.split(".",1)
for op in ["read", "write... | 27.634146 | 151 | 0.606355 |
import os
import subprocess
import json
import sys
import time
seconds = '60'
prefix = "/var/tmp"
filename = "mongotopy.json"
def reformat(data):
formatted = []
data = data['totals']
for dbcoll in data:
database, coll = dbcoll.split(".",1)
for op in ["read", "write"]:
for fiel... | true | true |
f72f9b9c8047300fbbc175a3ab3dd4814d1b1ad2 | 588 | py | Python | spam_v1/spam_last.py | Alpha-Demon404/RE-14 | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 39 | 2020-02-26T09:44:36.000Z | 2022-03-23T00:18:25.000Z | spam_v1/spam_last.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 15 | 2020-05-14T10:07:26.000Z | 2022-01-06T02:55:32.000Z | spam_v1/spam_last.py | B4BY-DG/reverse-enginnering | b5b46a9f0eee218f2a642b615c77135c33c6f4ad | [
"MIT"
] | 41 | 2020-03-16T22:36:38.000Z | 2022-03-17T14:47:19.000Z | import base64
print(base64.b64decode('KoQKiESIgQWZk5WZTBSbhB3UigCI05WayBHIgAiC0hXZ05SKpkSK5kTO5kTO5kDLwgCdulGZuFmcu02bk5WYyhic0N3KuF2clBHLv5GK0FWby9mZuISf71TZnF2czVWbm03e94GZzl2ctZSdrFWbyFmZ9IXZk5WZzZSOxkTM1tWYtJXYmBHdv1DZ3BnJ1tWYtJXYmBHdvlGch1jclNXd/AHaw5yctN3Lt92YuUmb5RWYu5Cc09WLpBXYv8iOwRHdoJCK0V2ZuMHdzVWdxVmcgACIKo... | 196 | 573 | 0.972789 | import base64
print(base64.b64decode('KoQKiESIgQWZk5WZTBSbhB3UigCI05WayBHIgAiC0hXZ05SKpkSK5kTO5kTO5kDLwgCdulGZuFmcu02bk5WYyhic0N3KuF2clBHLv5GK0FWby9mZuISf71TZnF2czVWbm03e94GZzl2ctZSdrFWbyFmZ9IXZk5WZzZSOxkTM1tWYtJXYmBHdv1DZ3BnJ1tWYtJXYmBHdvlGch1jclNXd/AHaw5yctN3Lt92YuUmb5RWYu5Cc09WLpBXYv8iOwRHdoJCK0V2ZuMHdzVWdxVmcgACIKo... | true | true |
f72f9baea74b1b509ef292d0c804f4d84afcdecf | 1,633 | py | Python | tests/test_utils_cfdi_amounts.py | joules457/cfdi-iva-snippet | e8a8c2a1acae43ee763906bb88514ca181dc4294 | [
"MIT"
] | null | null | null | tests/test_utils_cfdi_amounts.py | joules457/cfdi-iva-snippet | e8a8c2a1acae43ee763906bb88514ca181dc4294 | [
"MIT"
] | null | null | null | tests/test_utils_cfdi_amounts.py | joules457/cfdi-iva-snippet | e8a8c2a1acae43ee763906bb88514ca181dc4294 | [
"MIT"
] | null | null | null | """
Test cfdi/utils/cfdi_amounts
"""
import os
import pytest
from tests.resources import scenarios
from cfdi.utils import cfdi_amounts as cfdia
@pytest.fixture(scope='session')
def dir_path():
return os.path.dirname(
os.path.realpath(__file__)
)
def test_get_directory_cfdi_amounts(dir_path):
fo... | 34.020833 | 68 | 0.621555 | import os
import pytest
from tests.resources import scenarios
from cfdi.utils import cfdi_amounts as cfdia
@pytest.fixture(scope='session')
def dir_path():
return os.path.dirname(
os.path.realpath(__file__)
)
def test_get_directory_cfdi_amounts(dir_path):
for scenario in scenarios.CFDI_AMOUNTS:
... | true | true |
f72f9ceda3ef7eb7bbb0856f097daa4acc3c96a8 | 2,564 | py | Python | openverse_api/test/image_integration_test.py | MuhammadFaizanHaidar/openverse_api | 65a624f4ad8389ce2b41bf210248f0d7a9ef2f28 | [
"MIT"
] | null | null | null | openverse_api/test/image_integration_test.py | MuhammadFaizanHaidar/openverse_api | 65a624f4ad8389ce2b41bf210248f0d7a9ef2f28 | [
"MIT"
] | null | null | null | openverse_api/test/image_integration_test.py | MuhammadFaizanHaidar/openverse_api | 65a624f4ad8389ce2b41bf210248f0d7a9ef2f28 | [
"MIT"
] | 1 | 2021-11-02T17:58:29.000Z | 2021-11-02T17:58:29.000Z | """
End-to-end API tests for images. Can be used to verify a live deployment is
functioning as designed. Run with the `pytest -s` command from this directory.
"""
import json
import xml.etree.ElementTree as ET
from test.constants import API_URL
from test.media_integration import (
detail,
report,
search,
... | 25.137255 | 88 | 0.693058 |
import json
import xml.etree.ElementTree as ET
from test.constants import API_URL
from test.media_integration import (
detail,
report,
search,
search_consistency,
search_quotes,
search_special_chars,
stats,
thumb,
)
from urllib.parse import urlencode
import pytest
import requests
@py... | true | true |
f72fa0af1e6f927dec3c1c91f5deebd3c63f8593 | 10,076 | py | Python | python/tests/test_metadata.py | brianzhang01/tskit | e4d80810e19034cffa77bb14bc0b8d77537103ad | [
"MIT"
] | null | null | null | python/tests/test_metadata.py | brianzhang01/tskit | e4d80810e19034cffa77bb14bc0b8d77537103ad | [
"MIT"
] | null | null | null | python/tests/test_metadata.py | brianzhang01/tskit | e4d80810e19034cffa77bb14bc0b8d77537103ad | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2018-2019 Tskit Developers
# Copyright (c) 2017 University of Oxford
#
# 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 restrict... | 38.166667 | 89 | 0.609071 | import io
import json
import os
import tempfile
import unittest
import pickle
import numpy as np
import python_jsonschema_objects as pjs
import msprime
import tskit
class TestMetadataHdf5RoundTrip(unittest.TestCase):
def setUp(self):
fd, self.temp_file = tempfile.mkstemp(prefix="msp_hdf5meta_test_")
... | true | true |
f72fa0e8e5609366cc6f530508b8be45c3bde4a6 | 410 | py | Python | student-work/quinn_zepeda/exercism/python/difference-of-squares/difference_of_squares.py | developerQuinnZ/this_will_work | 5587a9fd030b47f9df6514e45c887b6872d2a4a1 | [
"MIT"
] | null | null | null | student-work/quinn_zepeda/exercism/python/difference-of-squares/difference_of_squares.py | developerQuinnZ/this_will_work | 5587a9fd030b47f9df6514e45c887b6872d2a4a1 | [
"MIT"
] | null | null | null | student-work/quinn_zepeda/exercism/python/difference-of-squares/difference_of_squares.py | developerQuinnZ/this_will_work | 5587a9fd030b47f9df6514e45c887b6872d2a4a1 | [
"MIT"
] | null | null | null | def square_of_sum(number):
count = 0
for i in range(1,number + 1):
count += i
c_squared = count**2
return c_squared
def sum_of_squares(number):
total = 0
for i in range(1,number + 1):
total = total + (i**2)
return total
def difference(number):
first = square_of_sum(num... | 20.5 | 35 | 0.617073 | def square_of_sum(number):
count = 0
for i in range(1,number + 1):
count += i
c_squared = count**2
return c_squared
def sum_of_squares(number):
total = 0
for i in range(1,number + 1):
total = total + (i**2)
return total
def difference(number):
first = square_of_sum(num... | true | true |
f72fa13b43a3421e3c2d1f7f4c41c033295dd9e3 | 385 | py | Python | tino/server.py | NotSoSmartDev/Tino | fd3a941cc1efe07cd9eff209a9e3735a8f7dd537 | [
"MIT"
] | 143 | 2020-06-10T06:07:26.000Z | 2022-03-02T10:09:16.000Z | tino/server.py | NotSoSmartDev/Tino | fd3a941cc1efe07cd9eff209a9e3735a8f7dd537 | [
"MIT"
] | 1 | 2020-06-12T21:52:57.000Z | 2020-06-12T21:52:57.000Z | tino/server.py | NotSoSmartDev/Tino | fd3a941cc1efe07cd9eff209a9e3735a8f7dd537 | [
"MIT"
] | 6 | 2020-06-11T19:21:52.000Z | 2021-12-21T08:33:27.000Z | import uvicorn
class Server(uvicorn.Server):
async def startup(self, sockets=None):
await super().startup(sockets=sockets)
for f in self.config.loaded_app.startup_funcs:
await f()
async def shutdown(self, sockets=None):
await super().shutdown(sockets=sockets)
for f... | 27.5 | 55 | 0.654545 | import uvicorn
class Server(uvicorn.Server):
async def startup(self, sockets=None):
await super().startup(sockets=sockets)
for f in self.config.loaded_app.startup_funcs:
await f()
async def shutdown(self, sockets=None):
await super().shutdown(sockets=sockets)
for f... | true | true |
f72fa17a88f924a7ba488b256d1381abe02cf435 | 381 | py | Python | src/vertex.py | lavish205/graph-db | 523cfd50ccb6fdc2644f595e3a76dd71e760bbb4 | [
"MIT"
] | 1 | 2020-09-05T03:07:35.000Z | 2020-09-05T03:07:35.000Z | src/vertex.py | lavish205/graph-db | 523cfd50ccb6fdc2644f595e3a76dd71e760bbb4 | [
"MIT"
] | null | null | null | src/vertex.py | lavish205/graph-db | 523cfd50ccb6fdc2644f595e3a76dd71e760bbb4 | [
"MIT"
] | null | null | null | from utils import Compression
class Vertex(object):
def __init__(self, identifier, ctype):
self.id = identifier
self.type = ctype
def compress(self):
return Compression.compress(self)
@staticmethod
def decompress(val):
return Compression.decompress(val)
def __repr... | 21.166667 | 49 | 0.643045 | from utils import Compression
class Vertex(object):
def __init__(self, identifier, ctype):
self.id = identifier
self.type = ctype
def compress(self):
return Compression.compress(self)
@staticmethod
def decompress(val):
return Compression.decompress(val)
def __repr... | true | true |
f72fa21904e69b4faea9e41fe537a9887bcd643e | 2,662 | py | Python | python/array.py | mr-uuid/snippets | 49bb59641d8160d7635b8d5e574cb50f9e5362e2 | [
"MIT"
] | null | null | null | python/array.py | mr-uuid/snippets | 49bb59641d8160d7635b8d5e574cb50f9e5362e2 | [
"MIT"
] | 1 | 2021-03-10T04:00:01.000Z | 2021-03-10T04:00:01.000Z | python/array.py | mr-uuid/snippets | 49bb59641d8160d7635b8d5e574cb50f9e5362e2 | [
"MIT"
] | null | null | null | import unittest
class Tester(unittest.TestCase):
def test_zip(self):
"""
zip takes to arrays and makes an array of tuples where tuple 1 is a
tuple composed of element 1 of array 1 and 2, etc...
"""
# combines to arrays into one array of tuples
self.assertEqual(
... | 30.25 | 79 | 0.472953 | import unittest
class Tester(unittest.TestCase):
def test_zip(self):
self.assertEqual(
zip(sorted(set('qwerty')), sorted(set('asdfgh'))),
[('e', 'a'), ('q', 'd'), ('r', 'f'),
('t', 'g'), ('w', 'h'), ('y', 's')]
)
questions = ['name', 'quest', ... | true | true |
f72fa31aa61c2010032ba331da9c46f0c28c8f64 | 586 | py | Python | recipys/types.py | gmso/recipys | 8ca39a7b0ace2c678fe7a5c8271c6843db6c2c35 | [
"MIT"
] | 13 | 2021-07-24T20:49:35.000Z | 2021-08-21T18:15:16.000Z | recipys/types.py | gmso/recipys | 8ca39a7b0ace2c678fe7a5c8271c6843db6c2c35 | [
"MIT"
] | 2 | 2021-08-17T17:11:09.000Z | 2021-09-01T19:05:17.000Z | recipys/types.py | gmso/recipys | 8ca39a7b0ace2c678fe7a5c8271c6843db6c2c35 | [
"MIT"
] | 1 | 2021-07-29T16:36:35.000Z | 2021-07-29T16:36:35.000Z | from dataclasses import dataclass
from typing import Optional, List
@dataclass
class RecipeConstraints:
meal: Optional[str] = None
ingredients: Optional[List[str]] = None
@dataclass
class Printable:
title: str = ""
ingredients: str = ""
preparation: str = ""
error_message: Opt... | 20.206897 | 44 | 0.677474 | from dataclasses import dataclass
from typing import Optional, List
@dataclass
class RecipeConstraints:
meal: Optional[str] = None
ingredients: Optional[List[str]] = None
@dataclass
class Printable:
title: str = ""
ingredients: str = ""
preparation: str = ""
error_message: Opt... | true | true |
f72fa471e47a678d1cdcba520ccfb797969a10c8 | 43 | py | Python | src/brython_jinja2/__init__.py | jonathanverner/brython-jinja2 | cec6e16de1750203a858d0acf590f230fc3bf848 | [
"BSD-3-Clause"
] | 2 | 2020-09-13T17:51:55.000Z | 2020-11-25T18:47:12.000Z | src/brython_jinja2/__init__.py | jonathanverner/brython-jinja2 | cec6e16de1750203a858d0acf590f230fc3bf848 | [
"BSD-3-Clause"
] | 2 | 2020-11-25T19:18:15.000Z | 2021-06-01T21:48:12.000Z | src/brython_jinja2/__init__.py | jonathanverner/brython-jinja2 | cec6e16de1750203a858d0acf590f230fc3bf848 | [
"BSD-3-Clause"
] | null | null | null | from . import platform
from . import utils
| 14.333333 | 22 | 0.767442 | from . import platform
from . import utils
| true | true |
f72fa4cf65c6c8ffeabe5891fa79f70b7f2fe473 | 8,228 | py | Python | app/worker/tasks/importers/historical_data_importer.py | CodeTheChangeUBC/reBOOT | df6a7d9990fc261c28bf65b83b561a765dc78723 | [
"MIT"
] | 10 | 2017-10-17T04:35:44.000Z | 2021-03-19T21:12:15.000Z | app/worker/tasks/importers/historical_data_importer.py | CodeTheChangeUBC/reBOOT | df6a7d9990fc261c28bf65b83b561a765dc78723 | [
"MIT"
] | 224 | 2017-10-18T18:33:48.000Z | 2022-02-02T03:33:04.000Z | app/worker/tasks/importers/historical_data_importer.py | CodeTheChangeUBC/reBOOT | df6a7d9990fc261c28bf65b83b561a765dc78723 | [
"MIT"
] | 1 | 2018-08-02T03:10:25.000Z | 2018-08-02T03:10:25.000Z | import re
from dateutil.parser import parse
from django.utils import timezone as tz
from .base_csv_importer import BaseCsvImporter
from app.constants.item_map import ITEM_MAP
from app.enums import ItemStatusEnum
from app.models import Donor, Donation, Item, ItemDevice, ItemDeviceType
class HistoricalDataImporter(Bas... | 34.426778 | 79 | 0.565386 | import re
from dateutil.parser import parse
from django.utils import timezone as tz
from .base_csv_importer import BaseCsvImporter
from app.constants.item_map import ITEM_MAP
from app.enums import ItemStatusEnum
from app.models import Donor, Donation, Item, ItemDevice, ItemDeviceType
class HistoricalDataImporter(Bas... | true | true |
f72fa56028b7563a6c7ecc30355b5545eb740df6 | 16,939 | py | Python | arxiv_public_data/authors.py | The-Collaboratory/arxiv-public-datasets | a3578b2a693c964ed8310d8ddc3a3801f33ce3c9 | [
"MIT"
] | null | null | null | arxiv_public_data/authors.py | The-Collaboratory/arxiv-public-datasets | a3578b2a693c964ed8310d8ddc3a3801f33ce3c9 | [
"MIT"
] | null | null | null | arxiv_public_data/authors.py | The-Collaboratory/arxiv-public-datasets | a3578b2a693c964ed8310d8ddc3a3801f33ce3c9 | [
"MIT"
] | null | null | null | # https://github.com/arXiv/arxiv-base@32e6ad0
"""
Copyright 2017 Cornell University
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
... | 36.040426 | 179 | 0.611724 |
import re
import os
import gzip
import json
from itertools import dropwhile
from typing import Dict, Iterator, List, Tuple
from multiprocessing import Pool, cpu_count
PREFIX_MATCH = 'van|der|de|la|von|del|della|da|mac|ter|dem|di|vaziri'
def parse_author_affil(authors: str) -> List[List[str]]:
return _parse_a... | true | true |
f72fa578f87bc853943bee3e503ed704b0ffd3fc | 32,916 | py | Python | plugin/lighthouse/composer/shell.py | chubbymaggie/lighthouse | e6c494a0c8dd2aca09b71b981e8c0c03d9078cdd | [
"MIT"
] | 1 | 2017-10-27T23:02:29.000Z | 2017-10-27T23:02:29.000Z | plugin/lighthouse/composer/shell.py | yrp604/lighthouse | b92a25906fb2513d8bfc4454c41e6378984d9ad9 | [
"MIT"
] | null | null | null | plugin/lighthouse/composer/shell.py | yrp604/lighthouse | b92a25906fb2513d8bfc4454c41e6378984d9ad9 | [
"MIT"
] | null | null | null | from .parser import *
from lighthouse.util import *
#------------------------------------------------------------------------------
# Composing Shell
#------------------------------------------------------------------------------
class ComposingShell(QtWidgets.QWidget):
"""
The ComposingShell UI for interacti... | 32.981964 | 105 | 0.571363 | from .parser import *
from lighthouse.util import *
class ComposingShell(QtWidgets.QWidget):
def __init__(self, director, model, table=None):
super(ComposingShell, self).__init__()
self.setObjectName(self.__class__.__name__)
self._director = director
self._palette = direc... | true | true |
f72fa5c26a43311b6bb327f0a6c60d08da6bf7f5 | 122 | py | Python | jobbing/models_remote/__init__.py | davidall-amdocs/jobbing | b13311da07606366dfbe2eb737483a5820038557 | [
"Apache-2.0"
] | null | null | null | jobbing/models_remote/__init__.py | davidall-amdocs/jobbing | b13311da07606366dfbe2eb737483a5820038557 | [
"Apache-2.0"
] | null | null | null | jobbing/models_remote/__init__.py | davidall-amdocs/jobbing | b13311da07606366dfbe2eb737483a5820038557 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# flake8: noqa
from __future__ import absolute_import
from jobbing.models_remote.zip_code import ZipCode | 20.333333 | 50 | 0.819672 |
from __future__ import absolute_import
from jobbing.models_remote.zip_code import ZipCode | true | true |
f72fa5d84e135d78f70840c368783f3034e3d49b | 2,946 | py | Python | payment_lib_examples/alipay-sdk-python/virtual_environment/lib/python3.4/site-packages/alipay/aop/api/domain/AOIinfo.py | cuhk-mobitec/S3KVetter | 9ae79a242afbe6edae27c17065a88feca2896cf6 | [
"Apache-2.0"
] | null | null | null | payment_lib_examples/alipay-sdk-python/virtual_environment/lib/python3.4/site-packages/alipay/aop/api/domain/AOIinfo.py | cuhk-mobitec/S3KVetter | 9ae79a242afbe6edae27c17065a88feca2896cf6 | [
"Apache-2.0"
] | null | null | null | payment_lib_examples/alipay-sdk-python/virtual_environment/lib/python3.4/site-packages/alipay/aop/api/domain/AOIinfo.py | cuhk-mobitec/S3KVetter | 9ae79a242afbe6edae27c17065a88feca2896cf6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AOIinfo(object):
def __init__(self):
self._adcode = None
self._area = None
self._distance = None
self._id = None
self._location = None
self._name =... | 25.396552 | 67 | 0.5241 | import json
from alipay.aop.api.constant.ParamConstants import *
class AOIinfo(object):
def __init__(self):
self._adcode = None
self._area = None
self._distance = None
self._id = None
self._location = None
self._name = None
@property
def adcode(self):
... | true | true |
f72fa5dd5997ddce41d5321eaba142024cd484ab | 21,887 | py | Python | setup.py | pexip/os-mod-wsgi | 969aee194275c599dd769c645c080dceeea5639e | [
"Apache-2.0"
] | 1 | 2019-04-22T16:49:34.000Z | 2019-04-22T16:49:34.000Z | setup.py | pexip/os-mod-wsgi | 969aee194275c599dd769c645c080dceeea5639e | [
"Apache-2.0"
] | null | null | null | setup.py | pexip/os-mod-wsgi | 969aee194275c599dd769c645c080dceeea5639e | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import os
import sys
import fnmatch
import subprocess
import tarfile
import shutil
import stat
import re
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
from setuptools import setup
from distutils.core import Extension
from ... | 36.971284 | 160 | 0.670489 | from __future__ import print_function
import os
import sys
import fnmatch
import subprocess
import tarfile
import shutil
import stat
import re
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
from setuptools import setup
from distutils.core import Extension
from ... | true | true |
f72fa655c2b497532a44793ccd4680c179b00048 | 4,942 | py | Python | zhiliao/filebrowsersafe/fields.py | gladgod/zhiliao | 573dfbe56734388c9657cb6749d267f4a8885d5b | [
"BSD-3-Clause"
] | null | null | null | zhiliao/filebrowsersafe/fields.py | gladgod/zhiliao | 573dfbe56734388c9657cb6749d267f4a8885d5b | [
"BSD-3-Clause"
] | null | null | null | zhiliao/filebrowsersafe/fields.py | gladgod/zhiliao | 573dfbe56734388c9657cb6749d267f4a8885d5b | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from future.builtins import str
from future.builtins import super
# coding: utf-8
# imports
import os
import datetime
# django imports
from django.db import models
from django import forms
from django.core.files.storage import default_storage
from django.forms.widgets import In... | 35.3 | 138 | 0.653784 | from __future__ import unicode_literals
from future.builtins import str
from future.builtins import super
import os
import datetime
from django.db import models
from django import forms
from django.core.files.storage import default_storage
from django.forms.widgets import Input
from django.db.models.fields import Fie... | true | true |
f72fa985b72bc3ee85306c46c1ed7734c3a40686 | 2,607 | py | Python | bahamutexporter/core/service.py | Yooootsuba/bahamut-exporter | 1fcf95f7eca86709ece1ed1d2704c540731682d5 | [
"MIT"
] | 2 | 2022-01-10T06:53:11.000Z | 2022-01-10T07:41:51.000Z | bahamutexporter/core/service.py | Yooootsuba/bahamut-exporter | 1fcf95f7eca86709ece1ed1d2704c540731682d5 | [
"MIT"
] | null | null | null | bahamutexporter/core/service.py | Yooootsuba/bahamut-exporter | 1fcf95f7eca86709ece1ed1d2704c540731682d5 | [
"MIT"
] | null | null | null | import re
import html
import json
import requests
from bs4 import BeautifulSoup
class BamahutExporterService:
def __init__(self):
self.session = requests.Session()
self.session.headers.update({'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.5... | 35.22973 | 159 | 0.513617 | import re
import html
import json
import requests
from bs4 import BeautifulSoup
class BamahutExporterService:
def __init__(self):
self.session = requests.Session()
self.session.headers.update({'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.5... | true | true |
f72faa1d19c3225e9a6701fb72dfb2c626ceba53 | 3,099 | py | Python | airflow/dags/udac_example_dag.py | aliiae/data-engineering | 96ee73a52de9504fc7e9eda748c90e0966c4fa03 | [
"MIT"
] | null | null | null | airflow/dags/udac_example_dag.py | aliiae/data-engineering | 96ee73a52de9504fc7e9eda748c90e0966c4fa03 | [
"MIT"
] | null | null | null | airflow/dags/udac_example_dag.py | aliiae/data-engineering | 96ee73a52de9504fc7e9eda748c90e0966c4fa03 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators import (
StageToRedshiftOperator,
LoadFactOperator,
LoadDimensionOperator,
DataQualityOperator,
)
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.postgres_operator import PostgresOp... | 28.431193 | 75 | 0.757018 | from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators import (
StageToRedshiftOperator,
LoadFactOperator,
LoadDimensionOperator,
DataQualityOperator,
)
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.postgres_operator import PostgresOp... | true | true |
f72faaed66845c4f79aa0c5322e4ebcb367d7bcc | 766 | py | Python | Misc/d3_heatmap.py | mahnooranjum/Python_Programming | ba251e0e855842112efeb968d06458c60eaf1bd3 | [
"MIT"
] | null | null | null | Misc/d3_heatmap.py | mahnooranjum/Python_Programming | ba251e0e855842112efeb968d06458c60eaf1bd3 | [
"MIT"
] | null | null | null | Misc/d3_heatmap.py | mahnooranjum/Python_Programming | ba251e0e855842112efeb968d06458c60eaf1bd3 | [
"MIT"
] | null | null | null | '''
Mahnoor Anjum
Python:
Trivariate Analysis
'''
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import math
import random
from mpl_toolkits.mplot3d import Axes3D
# sns.set()
path = 'data/private/savepath/'
filename = 'v3_1'
genpath = 'data/private/gen/'
... | 18.238095 | 45 | 0.66188 | import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import math
import random
from mpl_toolkits.mplot3d import Axes3D
path = 'data/private/savepath/'
filename = 'v3_1'
genpath = 'data/private/gen/'
genname = 'g3_1'
data = pd.read_csv(path + filename+'.csv')
gen = pd.read_csv... | true | true |
f72fab45a2f4c772cc4437cfc0c167040cf1b405 | 1,591 | py | Python | processout/invoicerisk.py | processout/processout-python | f8311702fe2d392817dcb66347a7a13b9cd91e92 | [
"MIT"
] | 1 | 2017-02-22T10:57:10.000Z | 2017-02-22T10:57:10.000Z | processout/invoicerisk.py | processout/processout-python | f8311702fe2d392817dcb66347a7a13b9cd91e92 | [
"MIT"
] | 1 | 2018-12-14T14:30:57.000Z | 2018-12-14T14:30:57.000Z | processout/invoicerisk.py | processout/processout-python | f8311702fe2d392817dcb66347a7a13b9cd91e92 | [
"MIT"
] | 2 | 2018-12-13T23:08:11.000Z | 2018-12-30T19:52:31.000Z | try:
from urllib.parse import quote_plus
except ImportError:
from urllib import quote_plus
import processout
import json
from processout.networking.request import Request
from processout.networking.response import Response
# The content of this file was automatically generated
class InvoiceRisk(object):
... | 23.057971 | 71 | 0.588938 | try:
from urllib.parse import quote_plus
except ImportError:
from urllib import quote_plus
import processout
import json
from processout.networking.request import Request
from processout.networking.response import Response
class InvoiceRisk(object):
def __init__(self, client, prefill = None):
s... | true | true |
f72fac17ae338185f2e1470376f1a6802595e44a | 1,514 | py | Python | jnpy/app/vnpy_webtrader/__init__.py | jojoquant/jonpy | 58692f8fbf398aab7be915a63d0a376e2e0e664c | [
"MIT"
] | 5 | 2020-05-19T07:32:39.000Z | 2022-03-14T09:09:48.000Z | jnpy/app/vnpy_webtrader/__init__.py | jojoquant/jonpy | 58692f8fbf398aab7be915a63d0a376e2e0e664c | [
"MIT"
] | null | null | null | jnpy/app/vnpy_webtrader/__init__.py | jojoquant/jonpy | 58692f8fbf398aab7be915a63d0a376e2e0e664c | [
"MIT"
] | 3 | 2020-04-02T08:30:17.000Z | 2020-05-03T12:12:05.000Z | # The MIT License (MIT)
#
# Copyright (c) 2015-present, Xiaoyou Chen
#
# 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... | 37.85 | 81 | 0.738441 |
from pathlib import Path
from vnpy.trader.app import BaseApp
from .engine import WebEngine, APP_NAME
class WebTraderApp(BaseApp):
app_name = APP_NAME
app_module = __module__
app_path = Path(__file__).parent
display_name = "Web服务"
engine_class = WebEngine
widget_name = "WebMa... | true | true |
f72facb0930186c23043da299ca86f58450425a0 | 3,448 | py | Python | src/plugins/radeky_bot/utils/bilibiliuploader/bilibiliuploader.py | Radekyspec/Radeky_bot | 24ee088026c7443723a5e9c72abfb512ca3b3327 | [
"MIT"
] | 4 | 2021-12-25T10:17:13.000Z | 2022-03-03T03:29:07.000Z | src/plugins/radeky_bot/utils/bilibiliuploader/bilibiliuploader.py | Radekyspec/Radeky_bot | 24ee088026c7443723a5e9c72abfb512ca3b3327 | [
"MIT"
] | null | null | null | src/plugins/radeky_bot/utils/bilibiliuploader/bilibiliuploader.py | Radekyspec/Radeky_bot | 24ee088026c7443723a5e9c72abfb512ca3b3327 | [
"MIT"
] | 1 | 2021-12-25T10:17:16.000Z | 2021-12-25T10:17:16.000Z | from . import core
from .util import cipher
from nonebot import logger
import json
class BilibiliUploader():
def __init__(self):
self.access_token = None
self.refresh_token = None
self.sid = None
self.mid = None
def login(self, username, password):
code, self.access_to... | 28.733333 | 107 | 0.476798 | from . import core
from .util import cipher
from nonebot import logger
import json
class BilibiliUploader():
def __init__(self):
self.access_token = None
self.refresh_token = None
self.sid = None
self.mid = None
def login(self, username, password):
code, self.access_to... | true | true |
f72fad071798fd320fcd248a5514555dad9f2802 | 1,006 | py | Python | netvisor_api_client/requests/product.py | ajmyyra/netvisor-api-client | b12f90606b8f66580873a1ff16737fa614aee5ef | [
"MIT"
] | null | null | null | netvisor_api_client/requests/product.py | ajmyyra/netvisor-api-client | b12f90606b8f66580873a1ff16737fa614aee5ef | [
"MIT"
] | null | null | null | netvisor_api_client/requests/product.py | ajmyyra/netvisor-api-client | b12f90606b8f66580873a1ff16737fa614aee5ef | [
"MIT"
] | null | null | null | """
netvisor.requests.product
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2013-2016 by Fast Monkeys Oy | 2019- by Heltti Oy
:license: MIT, see LICENSE for more details.
"""
from .base import Request
from ..exc import InvalidData
from ..responses.products import GetProductResponse, ProductListResponse
c... | 27.189189 | 73 | 0.621272 | from .base import Request
from ..exc import InvalidData
from ..responses.products import GetProductResponse, ProductListResponse
class GetProductRequest(Request):
method = 'GET'
uri = 'GetProduct.nv'
response_cls = GetProductResponse
def parse_response(self, response):
data = super(GetProduct... | true | true |
f72fad7595d798f28e7a2ab25421f74e4783d2ed | 4,409 | py | Python | tests/experimental/test_util.py | claytonlemons/python-pachyderm | 6e7f4c5c66486233390f4ba3f05a2056f1e21e9f | [
"Apache-2.0"
] | null | null | null | tests/experimental/test_util.py | claytonlemons/python-pachyderm | 6e7f4c5c66486233390f4ba3f05a2056f1e21e9f | [
"Apache-2.0"
] | null | null | null | tests/experimental/test_util.py | claytonlemons/python-pachyderm | 6e7f4c5c66486233390f4ba3f05a2056f1e21e9f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Tests of utility functions."""
import os
import json
import tempfile
import python_pachyderm
from python_pachyderm.experimental.service import pps_proto
from tests import util
# bp_to_pb: PfsInput -> PFSInput
# script that copies a file using just stdlibs
TEST_STDLIB_SOURCE = """
from shut... | 29.198675 | 97 | 0.635972 |
import os
import json
import tempfile
import python_pachyderm
from python_pachyderm.experimental.service import pps_proto
from tests import util
TEST_STDLIB_SOURCE = """
from shutil import copyfile
print("copying")
copyfile("/pfs/{}/file.dat", "/pfs/out/file.dat")
"""
TEST_LIB_SOURCE = """
from termcolor import c... | true | true |
f72fad937cc7df0f5730a5937036f84b9f33c80d | 1,322 | py | Python | src/evaluator.py | ryoutoku/real-coded-genetic-algorithm | 4d0c72527e497e57e18c56d43e8c217a388ca86f | [
"MIT"
] | 2 | 2019-05-14T02:04:02.000Z | 2020-04-02T00:19:01.000Z | src/evaluator.py | ryoutoku/real-coded-genetic-algorithm | 4d0c72527e497e57e18c56d43e8c217a388ca86f | [
"MIT"
] | null | null | null | src/evaluator.py | ryoutoku/real-coded-genetic-algorithm | 4d0c72527e497e57e18c56d43e8c217a388ca86f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
import math
from individual import Individual
class Evaluator(metaclass=ABCMeta):
def __init__(self):
Individual.set_evaluator(self)
def evaluate(self, individual):
"""個体を評価する
Args:
individual (individual):... | 20.338462 | 73 | 0.53177 | from abc import ABCMeta, abstractmethod
import math
from individual import Individual
class Evaluator(metaclass=ABCMeta):
def __init__(self):
Individual.set_evaluator(self)
def evaluate(self, individual):
return self._evaluate_function(individual.gene)
@abstractmethod
def _evaluate... | true | true |
f72fae73b6d958f9d94b097c0f0e32534effcad9 | 21,412 | py | Python | cogs/leveling.py | DevRohit06/Abode | 5864cdf3c74d51bea325d123e075a1becc541c91 | [
"MIT"
] | 15 | 2020-12-28T12:07:09.000Z | 2021-08-21T15:35:53.000Z | cogs/leveling.py | DevRohit06/Abode | 5864cdf3c74d51bea325d123e075a1becc541c91 | [
"MIT"
] | null | null | null | cogs/leveling.py | DevRohit06/Abode | 5864cdf3c74d51bea325d123e075a1becc541c91 | [
"MIT"
] | 8 | 2020-12-29T04:24:12.000Z | 2021-04-04T23:29:13.000Z | import discord
from discord.ext import commands, tasks
import datetime
import random
from prettytable import PrettyTable
import random
from random import randint
data = ['Water', 'Air', 'Earth', 'Fire', 'Destruction',
'Illusion', 'Time', 'Space', 'Karma', 'Chaos']
paths = random.choice(data)
luck = random.r... | 42.066798 | 240 | 0.500841 | import discord
from discord.ext import commands, tasks
import datetime
import random
from prettytable import PrettyTable
import random
from random import randint
data = ['Water', 'Air', 'Earth', 'Fire', 'Destruction',
'Illusion', 'Time', 'Space', 'Karma', 'Chaos']
paths = random.choice(data)
luck = random.r... | true | true |
f72fb037fc55f7ca2cf905ff81db0de58b739c7f | 363 | py | Python | trips-backend/tours/migrations/0003_auto_20210312_1921.py | pgarr/best-trips | edc45f6e822b70aa9bfa6f9d4ee8b2c58df54310 | [
"MIT"
] | null | null | null | trips-backend/tours/migrations/0003_auto_20210312_1921.py | pgarr/best-trips | edc45f6e822b70aa9bfa6f9d4ee8b2c58df54310 | [
"MIT"
] | null | null | null | trips-backend/tours/migrations/0003_auto_20210312_1921.py | pgarr/best-trips | edc45f6e822b70aa9bfa6f9d4ee8b2c58df54310 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-12 18:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('tours', '0002_auto_20210308_2016'),
]
operations = [
migrations.RenameField(
model_name='reservation',
old_name='user',
... | 19.105263 | 47 | 0.584022 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('tours', '0002_auto_20210308_2016'),
]
operations = [
migrations.RenameField(
model_name='reservation',
old_name='user',
new_name='owner',
),
]
| true | true |
f72fb07aed75906e4fd55adb3081b3b4d85b4c83 | 108 | py | Python | runscript_DDmass.py | HarrisonWinch96/DarkDisk_Microlensing | e25d59051771318239116a8d2036aca8ce70236d | [
"BSD-3-Clause"
] | null | null | null | runscript_DDmass.py | HarrisonWinch96/DarkDisk_Microlensing | e25d59051771318239116a8d2036aca8ce70236d | [
"BSD-3-Clause"
] | null | null | null | runscript_DDmass.py | HarrisonWinch96/DarkDisk_Microlensing | e25d59051771318239116a8d2036aca8ce70236d | [
"BSD-3-Clause"
] | null | null | null | from plotgen_functions import DD_mass_constraints
import sys
q = float(sys.argv[1])
DD_mass_constraints(q) | 18 | 49 | 0.824074 | from plotgen_functions import DD_mass_constraints
import sys
q = float(sys.argv[1])
DD_mass_constraints(q) | true | true |
f72fb1455f5a6d221b2e71016d342136e0b43efe | 127 | py | Python | instance/config.py | ags68/CS4398Project | a9652a3670fdbfd2f482104b77573a2d1f138c69 | [
"Unlicense"
] | 3 | 2017-02-27T02:13:52.000Z | 2017-03-05T03:54:25.000Z | instance/config.py | ags68/CS4398Project | a9652a3670fdbfd2f482104b77573a2d1f138c69 | [
"Unlicense"
] | null | null | null | instance/config.py | ags68/CS4398Project | a9652a3670fdbfd2f482104b77573a2d1f138c69 | [
"Unlicense"
] | null | null | null | # instance/config.py
SECRET_KEY = 'p9Bv<3Eid9%$i01'
SQLALCHEMY_DATABASE_URI = 'mysql://esss_admin:esss2017@localhost/esss_db'
| 25.4 | 73 | 0.787402 |
SECRET_KEY = 'p9Bv<3Eid9%$i01'
SQLALCHEMY_DATABASE_URI = 'mysql://esss_admin:esss2017@localhost/esss_db'
| true | true |
f72fb15cca4227d9405d5ece1245eb1451ce43c4 | 134,835 | py | Python | Lib/test/test_ssl.py | harveyqing/read_cPython_source | 3ff91638c8c9df6e5ac8dd5235447b5571781535 | [
"PSF-2.0"
] | 36 | 2015-02-04T10:43:31.000Z | 2022-03-30T13:01:12.000Z | Lib/test/test_ssl.py | harveyqing/read_cPython_source | 3ff91638c8c9df6e5ac8dd5235447b5571781535 | [
"PSF-2.0"
] | 9 | 2015-03-17T05:56:16.000Z | 2021-11-17T09:31:50.000Z | src/test/python/cpython-3f944f44ee41/Lib/test/test_ssl.py | bkiers/python3-parser | 38496e94b3935e5abca6ab86fd98136c51f92fd7 | [
"MIT"
] | 22 | 2015-05-13T17:37:35.000Z | 2022-01-25T06:24:42.000Z | # Test the support for SSL and sockets
import sys
import unittest
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import tempfile
import urllib.request
import traceback
import asyncore
import weakref
import platform
import functools
from u... | 44.780804 | 117 | 0.553135 |
import sys
import unittest
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import tempfile
import urllib.request
import traceback
import asyncore
import weakref
import platform
import functools
from unittest import mock
ssl = support.impo... | true | true |
f72fb180675bc7af5ad554ef5a79f7262a0c0838 | 5,272 | py | Python | devel/lib/python2.7/dist-packages/learning_topic/msg/_Person.py | youxiangming/ROS_learning | 29a88ed40982c71d32d469498ad67fba5d9d0943 | [
"MIT"
] | null | null | null | devel/lib/python2.7/dist-packages/learning_topic/msg/_Person.py | youxiangming/ROS_learning | 29a88ed40982c71d32d469498ad67fba5d9d0943 | [
"MIT"
] | null | null | null | devel/lib/python2.7/dist-packages/learning_topic/msg/_Person.py | youxiangming/ROS_learning | 29a88ed40982c71d32d469498ad67fba5d9d0943 | [
"MIT"
] | null | null | null | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from learning_topic/Person.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class Person(genpy.Message):
_md5sum = "8cf74e85a44e7a35ab62353a46e326a3"
_ty... | 30.830409 | 145 | 0.628604 | import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class Person(genpy.Message):
_md5sum = "8cf74e85a44e7a35ab62353a46e326a3"
_type = "learning_topic/Person"
_has_header = False _full_text = """string name
uint8 sex
uint8 age
uint8 unknown =0
uint8 ma... | true | true |
f72fb182d47331d80baf9b9fb6534806b6d38c8b | 1,856 | py | Python | appengine/tictactoe/webhandler.py | salendron/ai-kindergarten | 02782730753b7d9b70fcff2dcfbff0f7a4ed6e0e | [
"MIT"
] | null | null | null | appengine/tictactoe/webhandler.py | salendron/ai-kindergarten | 02782730753b7d9b70fcff2dcfbff0f7a4ed6e0e | [
"MIT"
] | null | null | null | appengine/tictactoe/webhandler.py | salendron/ai-kindergarten | 02782730753b7d9b70fcff2dcfbff0f7a4ed6e0e | [
"MIT"
] | null | null | null | from bottle import SimpleTemplate
from bottle import request
from .game import Game
from .player import AIPlayer
from .recorder import save_game, get_stats, get_last_training
player_names = {
'm': 'Bob',
'h': 'You'
}
def render_field(idx, game):
current_state = game.states[-1]
if current_state[idx] ... | 25.081081 | 95 | 0.609375 | from bottle import SimpleTemplate
from bottle import request
from .game import Game
from .player import AIPlayer
from .recorder import save_game, get_stats, get_last_training
player_names = {
'm': 'Bob',
'h': 'You'
}
def render_field(idx, game):
current_state = game.states[-1]
if current_state[idx] ... | true | true |
f72fb19d379b24571a1791dda2d07bd1524c5a49 | 1,313 | py | Python | Dynamic Obstacle Simulation/config.py | TSummersLab/Risk_Bounded_Nonlinear_Robot_Motion_Planning | 717b9f07f4ed625ee33ab8ec22ce78dc2907d759 | [
"MIT"
] | 3 | 2022-01-07T19:37:03.000Z | 2022-03-15T08:50:28.000Z | Dynamic Obstacle Simulation/config.py | TSummersLab/Risk_Bounded_Nonlinear_Robot_Motion_Planning | 717b9f07f4ed625ee33ab8ec22ce78dc2907d759 | [
"MIT"
] | null | null | null | Dynamic Obstacle Simulation/config.py | TSummersLab/Risk_Bounded_Nonlinear_Robot_Motion_Planning | 717b9f07f4ed625ee33ab8ec22ce78dc2907d759 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 16 12:59:37 2021
@author: vxr131730
Author: Venkatraman Renganathan
Email: vrengana@utdallas.edu
Github: https://github.com/venkatramanrenganathan
- Create a configuration file for RRT*. Functions that use RRT* outputs
will use some of these configurations
... | 24.314815 | 80 | 0.677837 | import numpy as np
import pickle
maxIter = 100
Trial_Num = 1
Trial_Total = 100
num_states = 6
num_outputs = 4
total_dim = num_states + num_outputs
estimatorSelector = 1
DRFlag = True
carTrackHorizon = 4
dynamicObs = True
obsVelocities = [0.10, 0.20]
velocitySelector = 0
if dynam... | true | true |
f72fb1b068a952dc4984202737257c15d8acf40e | 2,692 | py | Python | koans/about_asserts.py | sayeda-khaled/python_koans | c834a95ece3cb1dd87b5c9923089c8c5b60b7154 | [
"MIT"
] | null | null | null | koans/about_asserts.py | sayeda-khaled/python_koans | c834a95ece3cb1dd87b5c9923089c8c5b60b7154 | [
"MIT"
] | null | null | null | koans/about_asserts.py | sayeda-khaled/python_koans | c834a95ece3cb1dd87b5c9923089c8c5b60b7154 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutAsserts(Koan):
def test_assert_truth(self):
"""
We shall contemplate truth by testing reality, via asserts.
"""
# Confused? This video should help:
#
# http://bit.ly/about_asserts... | 31.302326 | 91 | 0.614413 |
from runner.koan import *
class AboutAsserts(Koan):
def test_assert_truth(self):
self.assertTrue(True)
def test_assert_with_message(self):
self.assertTrue(True, "This should be True -- Please fix this")
def test_fill_in_values(self):
... | true | true |
f72fb25142c4d22ce4847d1c4623c584a3ad02c2 | 1,326 | py | Python | aimsprop/pes.py | mtzgroup/aimsprop | 464d88ad7a817da73027fd2ab7b12476bf59f83d | [
"MIT"
] | 1 | 2022-03-28T13:11:56.000Z | 2022-03-28T13:11:56.000Z | aimsprop/pes.py | mtzgroup/aimsprop | 464d88ad7a817da73027fd2ab7b12476bf59f83d | [
"MIT"
] | 11 | 2021-03-17T17:53:58.000Z | 2021-07-17T17:59:25.000Z | aimsprop/pes.py | mtzgroup/aimsprop | 464d88ad7a817da73027fd2ab7b12476bf59f83d | [
"MIT"
] | 2 | 2021-04-05T08:36:35.000Z | 2021-05-20T22:12:12.000Z | import numpy as np
from .bundle import Bundle
def compute_pes(
bundle: Bundle,
carrier_frequency: float,
alpha: float,
eKT: np.ndarray,
) -> Bundle:
"""Compute the simple photoelectron spectroscopy, with Guassian blurring
User is responsible for calculating and assigning properties to the b... | 29.466667 | 86 | 0.610106 | import numpy as np
from .bundle import Bundle
def compute_pes(
bundle: Bundle,
carrier_frequency: float,
alpha: float,
eKT: np.ndarray,
) -> Bundle:
for frame in bundle.frames:
IPs = frame.properties["IP"]
dyson_norms = frame.properties["dyson_norms"]
pes = np.zeros_like... | true | true |
f72fb25f8ffe85e2f2a3357c66821d11c44d4856 | 17,524 | py | Python | salesforce/xmltodict.py | iechenybsh/exiahuangl | 6834ec0d40a53ece3c0ff738c5b728616da26a02 | [
"Apache-2.0"
] | 29 | 2016-12-15T07:14:44.000Z | 2022-03-17T17:24:08.000Z | salesforce/xmltodict.py | iechenybsh/exiahuangl | 6834ec0d40a53ece3c0ff738c5b728616da26a02 | [
"Apache-2.0"
] | 5 | 2017-02-14T02:04:44.000Z | 2019-02-19T19:25:22.000Z | salesforce/xmltodict.py | iechenybsh/exiahuangl | 6834ec0d40a53ece3c0ff738c5b728616da26a02 | [
"Apache-2.0"
] | 12 | 2016-12-16T08:02:45.000Z | 2020-02-20T00:00:58.000Z | #!/usr/bin/env python
"Makes working with XML feel like you are working with JSON"
## https://github.com/martinblech/xmltodict
try:
from defusedexpat import pyexpat as expat
except ImportError:
from xml.parsers import expat
from xml.sax.saxutils import XMLGenerator
from xml.sax.xmlreader import AttributesImpl
... | 37.127119 | 80 | 0.579605 |
try:
from defusedexpat import pyexpat as expat
except ImportError:
from xml.parsers import expat
from xml.sax.saxutils import XMLGenerator
from xml.sax.xmlreader import AttributesImpl
try: from cStringIO import StringIO
except ImportError: try:
from StringIO import StringIO
except ImportE... | true | true |
f72fb28880a0595528ca930a65ee989250ef37de | 410 | py | Python | src/index.py | dekokun/aws-lambda-parallelization-factor-test | a9d73cd15a3549e1b908cf4504c136173f54839c | [
"MIT"
] | 1 | 2019-12-19T10:37:50.000Z | 2019-12-19T10:37:50.000Z | src/index.py | dekokun/aws-lambda-parallelization-factor-test | a9d73cd15a3549e1b908cf4504c136173f54839c | [
"MIT"
] | null | null | null | src/index.py | dekokun/aws-lambda-parallelization-factor-test | a9d73cd15a3549e1b908cf4504c136173f54839c | [
"MIT"
] | null | null | null | import base64
import json
import time
def lambda_handler(event, context):
print ('start handler')
count = len(event['Records'])
print ('Get record count:')
print (count)
for record in event['Records']:
payload = base64.b64decode(record['kinesis']['data']).decode("utf-8")
print("Pa... | 24.117647 | 77 | 0.643902 | import base64
import json
import time
def lambda_handler(event, context):
print ('start handler')
count = len(event['Records'])
print ('Get record count:')
print (count)
for record in event['Records']:
payload = base64.b64decode(record['kinesis']['data']).decode("utf-8")
print("Pa... | true | true |
f72fb295397c8e42dff827498e5277948595c2fd | 926 | py | Python | backend/migrations/versions/d2f3d6010615_modify_message_table.py | ClassesOver/Stories | 419eb30b1afe053772be5e3e65b0cd1038eb0c81 | [
"Apache-2.0"
] | 1 | 2020-12-29T09:06:37.000Z | 2020-12-29T09:06:37.000Z | backend/migrations/versions/d2f3d6010615_modify_message_table.py | ClassesOver/blog | 419eb30b1afe053772be5e3e65b0cd1038eb0c81 | [
"Apache-2.0"
] | null | null | null | backend/migrations/versions/d2f3d6010615_modify_message_table.py | ClassesOver/blog | 419eb30b1afe053772be5e3e65b0cd1038eb0c81 | [
"Apache-2.0"
] | null | null | null | """modify message table
Revision ID: d2f3d6010615
Revises: fbb3ebcf5f90
Create Date: 2020-12-24 11:56:01.558233
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd2f3d6010615'
down_revision = 'fbb3ebcf5f90'
branch_labels = None
depends_on = None
def upgrade():... | 26.457143 | 88 | 0.698704 | from alembic import op
import sqlalchemy as sa
revision = 'd2f3d6010615'
down_revision = 'fbb3ebcf5f90'
branch_labels = None
depends_on = None
def upgrade():
with op.batch_alter_table('message', schema=None) as batch_op:
batch_op.add_column(sa.Column('res_id', sa.Integer(), nullable=True))
b... | true | true |
f72fb2fc1f4ca1f1629f405f76b905ba489cd3be | 1,136 | py | Python | app/core/tests/test_model.py | burakkirlaroglu/recipe-app-api | 0953921bce860502746af4447fb90136e7070faf | [
"MIT"
] | null | null | null | app/core/tests/test_model.py | burakkirlaroglu/recipe-app-api | 0953921bce860502746af4447fb90136e7070faf | [
"MIT"
] | null | null | null | app/core/tests/test_model.py | burakkirlaroglu/recipe-app-api | 0953921bce860502746af4447fb90136e7070faf | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTest(TestCase):
def test_create_user_with_email_successfully(self):
email = 'test@test.com'
password = '12345'
user = get_user_model().objects.create_user(
email=email,
passw... | 32.457143 | 79 | 0.649648 | from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTest(TestCase):
def test_create_user_with_email_successfully(self):
email = 'test@test.com'
password = '12345'
user = get_user_model().objects.create_user(
email=email,
passw... | true | true |
f72fb3a7fe0c4c14b9ceafe1c2d3cdb20fb8fa98 | 1,358 | py | Python | src/araugment/augment.py | ashaheedq/araugment | 53436c0c00c924f80238f9c4ae09c9966953e4d1 | [
"MIT"
] | null | null | null | src/araugment/augment.py | ashaheedq/araugment | 53436c0c00c924f80238f9c4ae09c9966953e4d1 | [
"MIT"
] | null | null | null | src/araugment/augment.py | ashaheedq/araugment | 53436c0c00c924f80238f9c4ae09c9966953e4d1 | [
"MIT"
] | null | null | null | # coding:utf-8
# author Abdulshaheed Alqunber
# version : 1.0.0
from google_trans_new import google_translator
import markovify as mk
def back_translate(text, language_src="ar", language_dst="zh"):
"""Translate text to a foreign language then translate back to original language to augment data
Parameters:
... | 31.581395 | 110 | 0.700295 | from google_trans_new import google_translator
import markovify as mk
def back_translate(text, language_src="ar", language_dst="zh"):
try:
t = google_translator()
translated_text = t.translate(text.strip(), language_dst)
translated_back = t.translate(translated_text, ... | true | true |
f72fb5cbe866769c53578f3efd0203eed8351817 | 11,982 | py | Python | configs/visualgenome_kr/VGCOCO_PredCls_motif_wS82_linearranker_faster_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 24 | 2021-10-14T03:28:28.000Z | 2022-03-29T09:30:04.000Z | configs/visualgenome_kr/VGCOCO_PredCls_motif_wS82_linearranker_faster_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-12-14T15:04:49.000Z | 2022-02-19T09:54:42.000Z | configs/visualgenome_kr/VGCOCO_PredCls_motif_wS82_linearranker_faster_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-10-31T11:23:06.000Z | 2021-12-17T06:38:50.000Z | # dataset settings
dataset_type = 'VisualGenomeKRDataset'
data_root = 'data/visualgenomekr/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_rel=True),
... | 36.867692 | 115 | 0.580204 | dataset_type = 'VisualGenomeKRDataset'
data_root = 'data/visualgenomekr/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_rel=True),
dict(type='Resiz... | true | true |
f72fb606aa4f0da5563e1b53b0ee4a213e3fad46 | 777 | py | Python | bindings/python/tools/python/ostk/mathematics/__init__.py | open-space-collective/library-mathematics | fdb4769a56a8fe35ffefb01a79c03cfca1f91958 | [
"Apache-2.0"
] | 5 | 2018-08-20T06:47:24.000Z | 2019-07-15T03:36:52.000Z | bindings/python/tools/python/ostk/mathematics/__init__.py | open-space-collective/open-space-toolkit-mathematics | 4b97f97f4aaa87bff848381a3519c6f764461378 | [
"Apache-2.0"
] | 6 | 2020-01-05T20:18:18.000Z | 2021-10-14T09:36:44.000Z | bindings/python/tools/python/ostk/mathematics/__init__.py | open-space-collective/open-space-toolkit-mathematics | 4b97f97f4aaa87bff848381a3519c6f764461378 | [
"Apache-2.0"
] | 2 | 2020-03-05T18:18:13.000Z | 2020-04-07T17:42:24.000Z | ################################################################################################################################################################
# @project Open Space Toolkit ▸ Mathematics
# @file bindings/python/tools/python/ostk/mathematics/__init__.py
# @author Lucas Brémond... | 51.8 | 160 | 0.262548 |
from ostk.core import *
from .OpenSpaceToolkitMathematicsPy import *
| true | true |
f72fb630e3bedcdefa0eb57e63dd067409e8bfcd | 440 | py | Python | src/core/__init__.py | el-ideal-ideas/MocaCommands | 33dda0b05ca3b34f4855ff264bcf70d016dfb1c0 | [
"MIT"
] | null | null | null | src/core/__init__.py | el-ideal-ideas/MocaCommands | 33dda0b05ca3b34f4855ff264bcf70d016dfb1c0 | [
"MIT"
] | null | null | null | src/core/__init__.py | el-ideal-ideas/MocaCommands | 33dda0b05ca3b34f4855ff264bcf70d016dfb1c0 | [
"MIT"
] | null | null | null | # -- Imports --------------------------------------------------------------------------
from .core import (
VERSION, TOP_DIR, CONFIG_DIR, LOG_DIR, SRC_DIR, STATIC_DIR, STORAGE_DIR, SYSTEM_CONFIG, SANIC_CONFIG, SERVER_CONFIG,
COMMANDS_DIR, COMMANDS_CONFIG, IP_BLACKLIST_FILE, API_KEY_FILE, SCRIPTS_DIR, system_co... | 48.888889 | 120 | 0.511364 |
from .core import (
VERSION, TOP_DIR, CONFIG_DIR, LOG_DIR, SRC_DIR, STATIC_DIR, STORAGE_DIR, SYSTEM_CONFIG, SANIC_CONFIG, SERVER_CONFIG,
COMMANDS_DIR, COMMANDS_CONFIG, IP_BLACKLIST_FILE, API_KEY_FILE, SCRIPTS_DIR, system_config, commands, ip_blacklist
)
| true | true |
f72fb6db38ad0943de7ba102448dbf868e181c11 | 18,487 | py | Python | MultiServer.py | Schulzer99/MultiWorld-Utilities | 031f7e6e21dc80290524e51c165cd28ac10747b3 | [
"MIT"
] | null | null | null | MultiServer.py | Schulzer99/MultiWorld-Utilities | 031f7e6e21dc80290524e51c165cd28ac10747b3 | [
"MIT"
] | null | null | null | MultiServer.py | Schulzer99/MultiWorld-Utilities | 031f7e6e21dc80290524e51c165cd28ac10747b3 | [
"MIT"
] | null | null | null | import argparse
import asyncio
import functools
import json
import logging
import re
import shlex
import urllib.request
import zlib
import ModuleUpdate
ModuleUpdate.update()
import websockets
import aioconsole
import Items
import Regions
from MultiClient import ReceivedItem, get_item_name_from_id, get_location_name_... | 42.793981 | 230 | 0.584411 | import argparse
import asyncio
import functools
import json
import logging
import re
import shlex
import urllib.request
import zlib
import ModuleUpdate
ModuleUpdate.update()
import websockets
import aioconsole
import Items
import Regions
from MultiClient import ReceivedItem, get_item_name_from_id, get_location_name_... | true | true |
f72fb70520827d455a85f96859c23ec6801cf6f3 | 5,184 | py | Python | tests/test_entrypoint.py | tdilauro/circulation-core | 8086ca8cbedd5f4b2a0c44df97889d078ff79aac | [
"Apache-2.0"
] | 1 | 2021-11-16T00:58:43.000Z | 2021-11-16T00:58:43.000Z | tests/test_entrypoint.py | tdilauro/circulation-core | 8086ca8cbedd5f4b2a0c44df97889d078ff79aac | [
"Apache-2.0"
] | 16 | 2021-05-17T19:24:47.000Z | 2021-12-15T13:57:34.000Z | tests/test_entrypoint.py | tdilauro/circulation-core | 8086ca8cbedd5f4b2a0c44df97889d078ff79aac | [
"Apache-2.0"
] | 1 | 2021-05-12T19:11:52.000Z | 2021-05-12T19:11:52.000Z | import json
import pytest
from ..entrypoint import (
AudiobooksEntryPoint,
EbooksEntryPoint,
EntryPoint,
EverythingEntryPoint,
MediumEntryPoint,
)
from ..external_search import Filter
from ..model import Edition, Work
from ..testing import DatabaseTest
class TestEntryPoint(DatabaseTest):
def... | 34.331126 | 82 | 0.673032 | import json
import pytest
from ..entrypoint import (
AudiobooksEntryPoint,
EbooksEntryPoint,
EntryPoint,
EverythingEntryPoint,
MediumEntryPoint,
)
from ..external_search import Filter
from ..model import Edition, Work
from ..testing import DatabaseTest
class TestEntryPoint(DatabaseTest):
def... | true | true |
f72fb746949f5509b0ded3a7b05fc061d6d0201a | 879 | bzl | Python | third_party/farmhash/workspace.bzl | dmpiergiacomo/tensorflow | 0ecdc6dc2dbc2381c9317f274bd39281294dfc97 | [
"Apache-2.0"
] | 6 | 2021-03-30T07:42:04.000Z | 2022-03-23T02:42:36.000Z | third_party/farmhash/workspace.bzl | dmpiergiacomo/tensorflow | 0ecdc6dc2dbc2381c9317f274bd39281294dfc97 | [
"Apache-2.0"
] | 1,056 | 2019-12-15T01:20:31.000Z | 2022-02-10T02:06:28.000Z | third_party/farmhash/workspace.bzl | dmpiergiacomo/tensorflow | 0ecdc6dc2dbc2381c9317f274bd39281294dfc97 | [
"Apache-2.0"
] | 6 | 2016-09-07T04:00:15.000Z | 2022-01-12T01:47:38.000Z | """Provides the repository macro to import farmhash."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports farmhash."""
# Attention: tools parse and update these lines.
FARMHASH_COMMIT = "816a4ae622e964763ca0862d9dbd19324a1eaf45"
FARMHASH_SHA256 = "6560547c63e4af82b0f202cb710cea... | 39.954545 | 151 | 0.697383 |
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
FARMHASH_COMMIT = "816a4ae622e964763ca0862d9dbd19324a1eaf45"
FARMHASH_SHA256 = "6560547c63e4af82b0f202cb710ceabb3f21347a4b996db565a411da5b17aba0"
tf_http_archive(
name = "farmhash_archive",
build_file = "//third_party/farm... | true | true |
f72fb7689d8d911e8d95780e9541175223f17521 | 2,251 | py | Python | apis/forecast.py | mrasap/powderbooking_backend | ffc6e31f52bd78a18293adbfbb30cd0211a4700c | [
"Apache-2.0"
] | null | null | null | apis/forecast.py | mrasap/powderbooking_backend | ffc6e31f52bd78a18293adbfbb30cd0211a4700c | [
"Apache-2.0"
] | null | null | null | apis/forecast.py | mrasap/powderbooking_backend | ffc6e31f52bd78a18293adbfbb30cd0211a4700c | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Michael Kemna.
#
# 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 agreed to in wri... | 38.810345 | 90 | 0.749889 | from flask_restplus import Namespace, Resource
from powderbooking.models import model_forecast
from sqlalchemy import MetaData
from database import db
from database.query import Query
from utils.convert_models import convert_sqlalchemy_to_restplus_model
api = Namespace('forecast', description='Weather reports of a o... | true | true |
f72fb77842fa2f02ed07d03d38852d1b6dade3ed | 1,296 | py | Python | src/fetchcode/vcs/pip/_internal/utils/pkg_resources.py | quepop/fetchcode | ac2461bdf7a249d8815987b4d421dbc615c043b9 | [
"Apache-2.0"
] | 7 | 2019-10-04T07:27:41.000Z | 2021-06-07T04:39:18.000Z | src/fetchcode/vcs/pip/_internal/utils/pkg_resources.py | quepop/fetchcode | ac2461bdf7a249d8815987b4d421dbc615c043b9 | [
"Apache-2.0"
] | 64 | 2019-10-07T12:40:56.000Z | 2022-02-17T18:44:37.000Z | src/fetchcode/vcs/pip/_internal/utils/pkg_resources.py | quepop/fetchcode | ac2461bdf7a249d8815987b4d421dbc615c043b9 | [
"Apache-2.0"
] | 16 | 2019-10-04T08:48:12.000Z | 2021-06-11T01:22:56.000Z | from fetchcode.vcs.pip._vendor.pkg_resources import yield_lines
from fetchcode.vcs.pip._vendor.six import ensure_str
from fetchcode.vcs.pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Dict, Iterable, List
class DictMetadata(object):
"""IMetadataProvider that re... | 28.8 | 71 | 0.631944 | from fetchcode.vcs.pip._vendor.pkg_resources import yield_lines
from fetchcode.vcs.pip._vendor.six import ensure_str
from fetchcode.vcs.pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Dict, Iterable, List
class DictMetadata(object):
def __init__(self, metadata)... | true | true |
f72fb8bd9479fd40d29757e53cc63e0a56a9ebf3 | 757 | py | Python | leo/plugins/quit_leo.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | 1 | 2021-02-08T21:22:38.000Z | 2021-02-08T21:22:38.000Z | leo/plugins/quit_leo.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | null | null | null | leo/plugins/quit_leo.py | ATikhonov2/leo-editor | 225aac990a9b2804aaa9dea29574d6e072e30474 | [
"MIT"
] | null | null | null | #@+leo-ver=5-thin
#@+node:edream.110203113231.734: * @file ../plugins/quit_leo.py
""" Shows how to force Leo to quit."""
#@@language python
#@@tabwidth -4
from leo.core import leoGlobals as g
def init():
'''Return True if the plugin has loaded successfully.'''
ok = not g.app.unitTesting # Not for unit testing.... | 30.28 | 72 | 0.620872 | from leo.core import leoGlobals as g
def init():
ok = not g.app.unitTesting if ok:
def forceLeoToQuit(tag, keywords):
if not g.app.initing:
g.pr("forceLeoToQuit", tag)
g.app.forceShutdown()
g.pr(__doc__)
g.registerHandler("id... | true | true |
f72fb9520e3654537387e3873817fd1158160606 | 1,721 | py | Python | deeptennis/data/transforms.py | sethah/deeptennis | a689c5f1d6f5ff1d665aec99b8db6262d3442c3a | [
"MIT"
] | 27 | 2018-11-23T21:37:14.000Z | 2021-11-22T08:44:35.000Z | deeptennis/data/transforms.py | sethah/deeptennis | a689c5f1d6f5ff1d665aec99b8db6262d3442c3a | [
"MIT"
] | 6 | 2019-07-09T16:26:56.000Z | 2021-05-17T17:29:42.000Z | deeptennis/data/transforms.py | sethah/deeptennis | a689c5f1d6f5ff1d665aec99b8db6262d3442c3a | [
"MIT"
] | 4 | 2019-06-11T06:44:30.000Z | 2021-02-27T14:49:02.000Z | import numpy as np
import albumentations.augmentations.functional as af
from albumentations.core.transforms_interface import DualTransform
from allencv.data.transforms import _ImageTransformWrapper, ImageTransform
class CourtKeypointFlip(DualTransform):
"""Flip the input horizontally around the y-axis.
Arg... | 34.42 | 103 | 0.651365 | import numpy as np
import albumentations.augmentations.functional as af
from albumentations.core.transforms_interface import DualTransform
from allencv.data.transforms import _ImageTransformWrapper, ImageTransform
class CourtKeypointFlip(DualTransform):
def apply(self, img, **params):
if img.ndim == 3 ... | true | true |
f72fbad2adffd95d82e895b59a2b7ca1499c137d | 193 | py | Python | python/interpret-core/interpret/greybox/__init__.py | prateekiiest/interpret | b5530a587251a77516ab443037fc37f71708564c | [
"MIT"
] | 2,674 | 2019-10-03T14:14:35.000Z | 2022-03-31T13:40:49.000Z | python/interpret-core/interpret/greybox/__init__.py | prateekiiest/interpret | b5530a587251a77516ab443037fc37f71708564c | [
"MIT"
] | 257 | 2019-11-08T19:22:56.000Z | 2022-03-29T20:09:07.000Z | python/interpret-core/interpret/greybox/__init__.py | prateekiiest/interpret | b5530a587251a77516ab443037fc37f71708564c | [
"MIT"
] | 367 | 2019-10-31T15:33:21.000Z | 2022-03-31T13:40:50.000Z | # Copyright (c) 2019 Microsoft Corporation
# Distributed under the MIT software license
from .treeinterpreter import TreeInterpreter # noqa: F401
from .shaptree import ShapTree # noqa: F401
| 32.166667 | 58 | 0.792746 |
from .treeinterpreter import TreeInterpreter from .shaptree import ShapTree | true | true |
f72fbadd2f5f8ca5d3e6c9fc5dc5627d098e888f | 5,496 | py | Python | source/generate_symbolic_derivatives.py | daccordeon/CEonlyPony | 7af50792a3a28101391397fce1e2b5e01d919701 | [
"BSD-3-Clause"
] | null | null | null | source/generate_symbolic_derivatives.py | daccordeon/CEonlyPony | 7af50792a3a28101391397fce1e2b5e01d919701 | [
"BSD-3-Clause"
] | null | null | null | source/generate_symbolic_derivatives.py | daccordeon/CEonlyPony | 7af50792a3a28101391397fce1e2b5e01d919701 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""Generate symbolic derivatives as lambdified functions for gwbench.
When run as a script: generate all symbolic derivatives for tf2_tidal at all standard locations ahead of benchmarking.
Slurm gets upset when multiple tasks try to create the derivatives if there aren't any there already, so ru... | 39.539568 | 119 | 0.691776 | from typing import List, Set, Dict, Tuple, Optional, Union
import os
from gwbench import wf_class as wfc
from gwbench import detector_response_derivatives as drd
def generate_symbolic_derivatives(
wf_model_name: str,
wf_other_var_dic: Optional[Dict[str, str]],
deriv_symbs_string: str,
locs: List[str]... | true | true |
f72fbb46da1ac696d933485cf3bec183189f023a | 1,181 | py | Python | setup.py | i008/neptune-contrib | 4071c44112da4d7c52ee42cbb1ba937a66e5845b | [
"MIT"
] | null | null | null | setup.py | i008/neptune-contrib | 4071c44112da4d7c52ee42cbb1ba937a66e5845b | [
"MIT"
] | null | null | null | setup.py | i008/neptune-contrib | 4071c44112da4d7c52ee42cbb1ba937a66e5845b | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
def main():
extras = {
'bots': ['python-telegram-bot'],
'hpo': ['scikit-optimize==0.5.2', 'scipy'],
'monitoring': ['scikit-optimize==0.5.2', 'sacred==0.7.5', 'scikit-learn==0.21.3',
'scikit-plot==0.3.7', 'seaborn==0.8.1', '... | 31.078947 | 110 | 0.580017 | from setuptools import find_packages, setup
def main():
extras = {
'bots': ['python-telegram-bot'],
'hpo': ['scikit-optimize==0.5.2', 'scipy'],
'monitoring': ['scikit-optimize==0.5.2', 'sacred==0.7.5', 'scikit-learn==0.21.3',
'scikit-plot==0.3.7', 'seaborn==0.8.1', '... | true | true |
f72fbc9ef2815a7c16260374b2af5e47dc631fe1 | 5,099 | py | Python | dev_scripts/chemenv/equivalent_indices.py | frssp/pymatgen | bdd977f065b66191557c7398b31a1571bc541fdb | [
"MIT"
] | 5 | 2019-04-11T20:57:38.000Z | 2021-12-01T05:00:42.000Z | dev_scripts/chemenv/equivalent_indices.py | darnoceloc/pymatgen | 5cc42912a12a265a603df7e34c856561f76edc1f | [
"MIT"
] | 3 | 2017-07-18T01:13:41.000Z | 2019-04-29T18:17:30.000Z | dev_scripts/chemenv/equivalent_indices.py | darnoceloc/pymatgen | 5cc42912a12a265a603df7e34c856561f76edc1f | [
"MIT"
] | 3 | 2019-10-14T19:47:34.000Z | 2020-07-02T08:10:45.000Z | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
Development script of the ChemEnv utility to get the equivalent indices of the model coordination environments
"""
__author__ = "David Waroquiers"
__copyr... | 34.452703 | 110 | 0.442636 |
from __future__ import division, unicode_literals
__author__ = "David Waroquiers"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "2.0"
__maintainer__ = "David Waroquiers"
__email__ = "david.waroquiers@gmail.com"
__date__ = "Feb 20, 2016"
import numpy as np
if __name__ == '__main__':
cg... | true | true |
f72fbcceb7f7342d732b521612c2db620aa6ae77 | 15,134 | py | Python | neutron/agent/l3/extensions/qos/fip.py | netsec/neutron | 17f90e17f139dc47eaafa1d3e342eb87ff0f61ed | [
"Apache-2.0"
] | null | null | null | neutron/agent/l3/extensions/qos/fip.py | netsec/neutron | 17f90e17f139dc47eaafa1d3e342eb87ff0f61ed | [
"Apache-2.0"
] | null | null | null | neutron/agent/l3/extensions/qos/fip.py | netsec/neutron | 17f90e17f139dc47eaafa1d3e342eb87ff0f61ed | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 OpenStack Foundation
# 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 requ... | 43.24 | 79 | 0.619466 |
from neutron_lib.agent import l3_extension
from neutron_lib import constants
from neutron_lib.services.qos import constants as qos_consts
from oslo_concurrency import lockutils
from oslo_log import log as logging
from neutron.agent.l3.extensions.qos import base as qos_base
from neutron.agent.linux import ip_lib
from ... | true | true |
f72fbced7d7530fbca0bf7e3bb8adb613862ba38 | 183 | py | Python | Euler/Problem_16.py | ChristensenCode/energy-viking | 7a720cbcfabcb020ed42d52462bfad4058b0c20f | [
"MIT"
] | null | null | null | Euler/Problem_16.py | ChristensenCode/energy-viking | 7a720cbcfabcb020ed42d52462bfad4058b0c20f | [
"MIT"
] | null | null | null | Euler/Problem_16.py | ChristensenCode/energy-viking | 7a720cbcfabcb020ed42d52462bfad4058b0c20f | [
"MIT"
] | null | null | null | # Problem 16 Power Digit Sum
x = 2**1000
print(x)
value = str(2**1000)
totalling = []
for i in range(len(value)):
total = int(value[i])
totalling.append(total)
print(sum(totalling)) | 20.333333 | 28 | 0.688525 | x = 2**1000
print(x)
value = str(2**1000)
totalling = []
for i in range(len(value)):
total = int(value[i])
totalling.append(total)
print(sum(totalling)) | true | true |
f72fbf0efa739283e1861ea301b93db9d409887a | 1,174 | py | Python | neutron/db/migration/alembic_migrations/versions/1f71e54a85e7_ml2_net_seg_model.py | gampel/neutron | 51a6260266dc59c066072ca890ad9c40b1aad6cf | [
"Apache-2.0"
] | 10 | 2015-09-22T10:22:53.000Z | 2016-02-25T06:12:05.000Z | neutron/db/migration/alembic_migrations/versions/1f71e54a85e7_ml2_net_seg_model.py | gampel/neutron | 51a6260266dc59c066072ca890ad9c40b1aad6cf | [
"Apache-2.0"
] | 12 | 2015-01-08T18:30:45.000Z | 2015-03-13T21:04:15.000Z | neutron/db/migration/alembic_migrations/versions/1f71e54a85e7_ml2_net_seg_model.py | gampel/neutron | 51a6260266dc59c066072ca890ad9c40b1aad6cf | [
"Apache-2.0"
] | 7 | 2015-02-05T10:23:52.000Z | 2019-05-18T17:11:19.000Z | # Copyright 2014 OpenStack Foundation
#
# 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 ... | 28.634146 | 78 | 0.721465 |
revision = '1f71e54a85e7'
down_revision = '44621190bc02'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('ml2_network_segments',
sa.Column('segment_index', sa.Integer(), nullable=False,
server_default='0'))
def downgrade():
op.drop_column('... | true | true |
f72fbf450177a71f28c55fbc60c587342b06a61a | 26,495 | py | Python | scikits/crab/recommenders/knn/classes.py | MostaSchoolOfAI/crab | 1c1fc21e902e4ee422ab367d691df16978972f8c | [
"BSD-3-Clause"
] | null | null | null | scikits/crab/recommenders/knn/classes.py | MostaSchoolOfAI/crab | 1c1fc21e902e4ee422ab367d691df16978972f8c | [
"BSD-3-Clause"
] | null | null | null | scikits/crab/recommenders/knn/classes.py | MostaSchoolOfAI/crab | 1c1fc21e902e4ee422ab367d691df16978972f8c | [
"BSD-3-Clause"
] | null | null | null | """
Generalized Recommender models.
This module contains basic memory recommender interfaces used throughout
the whole scikit-crab package.
The interfaces are realized as abstract base classes (ie., some optional
functionality is provided in the interface itself, so that the interfaces
can be subclassed).
"""
# Aut... | 37.316901 | 98 | 0.627062 |
from sklearn.base import BaseEstimator
from .base import ItemRecommender, UserRecommender
from .item_strategies import ItemsNeighborhoodStrategy
from .neighborhood_strategies import NearestNeighborsStrategy
import numpy as np
class ItemBasedRecommender(ItemRecommender):
def __init__(self, model, similarity, ite... | true | true |
f72fbfc6053fee1b605915399588d9a35599ebe1 | 13,242 | py | Python | care/utils/tests/test_base.py | agzuniverse/care | 952babf5b394921fcdb4fd4b1405cb571261f322 | [
"MIT"
] | null | null | null | care/utils/tests/test_base.py | agzuniverse/care | 952babf5b394921fcdb4fd4b1405cb571261f322 | [
"MIT"
] | null | null | null | care/utils/tests/test_base.py | agzuniverse/care | 952babf5b394921fcdb4fd4b1405cb571261f322 | [
"MIT"
] | null | null | null | import abc
import datetime
from collections import OrderedDict
from typing import Any, Dict
import dateparser
from django.contrib.gis.geos import Point
from pytz import unicode
from rest_framework import status
from rest_framework.test import APITestCase
from care.facility.models import (
CATEGORY_CHOICES,
DI... | 35.596774 | 118 | 0.589337 | import abc
import datetime
from collections import OrderedDict
from typing import Any, Dict
import dateparser
from django.contrib.gis.geos import Point
from pytz import unicode
from rest_framework import status
from rest_framework.test import APITestCase
from care.facility.models import (
CATEGORY_CHOICES,
DI... | true | true |
f72fc0334115b183ce538c3c6dd415915cddc916 | 1,223 | py | Python | data_statistics.py | Dipeshtamboli/domain-shift | 3f29577df6ab7269ad69a5fc651b63ed78708f0b | [
"MIT"
] | null | null | null | data_statistics.py | Dipeshtamboli/domain-shift | 3f29577df6ab7269ad69a5fc651b63ed78708f0b | [
"MIT"
] | null | null | null | data_statistics.py | Dipeshtamboli/domain-shift | 3f29577df6ab7269ad69a5fc651b63ed78708f0b | [
"MIT"
] | null | null | null | import pdb
import numpy as np
import os
import glob
import torch
import torch.nn as nn
import torchvision.models as models
import torchvision.transforms as transforms
from torch.autograd import Variable
from PIL import Image
from tqdm import tqdm
relative_path = 'datasets/resnet_features_subset_office31/'
... | 33.054054 | 112 | 0.713001 | import pdb
import numpy as np
import os
import glob
import torch
import torch.nn as nn
import torchvision.models as models
import torchvision.transforms as transforms
from torch.autograd import Variable
from PIL import Image
from tqdm import tqdm
relative_path = 'datasets/resnet_features_subset_office31/'
... | true | true |
f72fc06d644f387753e387544faebf08963a1082 | 16,871 | py | Python | tensorflow_probability/python/distributions/poisson_lognormal.py | hephaex/probability | 740d0db0bf2b1e1a04cfd0b55481c44380b3cb05 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/poisson_lognormal.py | hephaex/probability | 740d0db0bf2b1e1a04cfd0b55481c44380b3cb05 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/poisson_lognormal.py | hephaex/probability | 740d0db0bf2b1e1a04cfd0b55481c44380b3cb05 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# 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 o... | 39.510539 | 80 | 0.684073 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from tensorflow_probability.python.bijectors import exp as exp_bijector
from tensorflow_probability.python.distributions import categorical
from tensorflow_probabili... | true | true |
f72fc09102b906fd3f59703976525e7e5cd9e483 | 2,338 | py | Python | tests/test_paramark.py | mrzechonek/pytest-paramark | 2c899e200eb0d68e66cd4e32e46c9cdd396845ec | [
"MIT"
] | 1 | 2021-12-23T11:21:16.000Z | 2021-12-23T11:21:16.000Z | tests/test_paramark.py | mrzechonek/pytest-paramark | 2c899e200eb0d68e66cd4e32e46c9cdd396845ec | [
"MIT"
] | null | null | null | tests/test_paramark.py | mrzechonek/pytest-paramark | 2c899e200eb0d68e66cd4e32e46c9cdd396845ec | [
"MIT"
] | null | null | null | from namedlist import namedlist
import pytest
# fmt: off
@pytest.fixture(indirect=True)
def foo(request):
Foo = namedlist('Foo', (
('some_option', 42),
('another_option', 'test'),
))
return Foo(**request.param)
@pytest.fixture(indirect=True)
def bar(request):
Bar = namedlist('Bar',... | 20.155172 | 55 | 0.641574 | from namedlist import namedlist
import pytest
@pytest.fixture(indirect=True)
def foo(request):
Foo = namedlist('Foo', (
('some_option', 42),
('another_option', 'test'),
))
return Foo(**request.param)
@pytest.fixture(indirect=True)
def bar(request):
Bar = namedlist('Bar', (
... | true | true |
f72fc0b2e52b6be3a20c325a24aba237a4e6319d | 1,372 | py | Python | bigtable/hello_happybase/main_test.py | thesugar/python-docs-samples | 1a59ca688f1d7602d52cd4088fa7b6e3afe0afd0 | [
"Apache-2.0"
] | 34 | 2020-07-27T19:14:01.000Z | 2022-03-31T14:46:53.000Z | bigtable/hello_happybase/main_test.py | thesugar/python-docs-samples | 1a59ca688f1d7602d52cd4088fa7b6e3afe0afd0 | [
"Apache-2.0"
] | 254 | 2020-01-31T23:44:06.000Z | 2022-03-23T22:52:49.000Z | bigtable/hello_happybase/main_test.py | thesugar/python-docs-samples | 1a59ca688f1d7602d52cd4088fa7b6e3afe0afd0 | [
"Apache-2.0"
] | 30 | 2020-01-31T20:45:34.000Z | 2022-03-23T19:56:42.000Z | # Copyright 2016 Google 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 agreed to in writing, ... | 32.666667 | 74 | 0.729592 |
import os
import random
from main import main
PROJECT = os.environ['GOOGLE_CLOUD_PROJECT']
BIGTABLE_INSTANCE = os.environ['BIGTABLE_INSTANCE']
TABLE_NAME_FORMAT = 'hello-world-hb-test-{}'
TABLE_NAME_RANGE = 10000
def test_main(capsys):
table_name = TABLE_NAME_FORMAT.format(
random.randrange(TABLE_NAME_... | true | true |
f72fc11fa59ceffe2e3f49244bef15eddabf9421 | 7,807 | py | Python | cloudcafe/compute/flavors_api/models/flavor.py | ProjectMeniscus/cloudcafe | fa8fd796b303f0c5f0d6e98b2b5d01f6ea8fefe9 | [
"Apache-2.0"
] | null | null | null | cloudcafe/compute/flavors_api/models/flavor.py | ProjectMeniscus/cloudcafe | fa8fd796b303f0c5f0d6e98b2b5d01f6ea8fefe9 | [
"Apache-2.0"
] | null | null | null | cloudcafe/compute/flavors_api/models/flavor.py | ProjectMeniscus/cloudcafe | fa8fd796b303f0c5f0d6e98b2b5d01f6ea8fefe9 | [
"Apache-2.0"
] | 1 | 2020-11-17T19:05:08.000Z | 2020-11-17T19:05:08.000Z | """
Copyright 2013 Rackspace
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 agreed to in writing, software
dist... | 34.39207 | 77 | 0.599846 |
import json
import xml.etree.ElementTree as ET
from cafe.engine.models.base import AutoMarshallingModel
from cloudcafe.compute.common.equality_tools import EqualityTools
from cloudcafe.compute.common.constants import Constants
from cloudcafe.compute.common.models.link import Links
class CreateFlavor(AutoMarshalling... | true | true |
f72fc1298f0c5130bd5594ba286c250a4a144484 | 524 | py | Python | build/srslib_test/catkin_generated/pkg.develspace.context.pc.py | 6RiverSystems/darknet_ros | 03c72b96afa99f7cc75f7792b51deb4a7f4ed379 | [
"BSD-3-Clause"
] | null | null | null | build/srslib_test/catkin_generated/pkg.develspace.context.pc.py | 6RiverSystems/darknet_ros | 03c72b96afa99f7cc75f7792b51deb4a7f4ed379 | [
"BSD-3-Clause"
] | null | null | null | build/srslib_test/catkin_generated/pkg.develspace.context.pc.py | 6RiverSystems/darknet_ros | 03c72b96afa99f7cc75f7792b51deb4a7f4ed379 | [
"BSD-3-Clause"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/kalyco/mfp_workspace/src/srslib_test/include".split(';') if "/home/kalyco/mfp_workspace/src/srslib_test/include" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_W... | 58.222222 | 167 | 0.757634 | CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/kalyco/mfp_workspace/src/srslib_test/include".split(';') if "/home/kalyco/mfp_workspace/src/srslib_test/include" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "-lsrslib_test".split(';') if "-lsrslib_test... | true | true |
f72fc212dd0b3eb11cf3285fa9470daba40b1324 | 9,865 | py | Python | web3/providers/eth_tester/middleware.py | ayushkumar63123/web3.py | 4dda2db9d27a409f1a9c2b4a8ec917b53c51383f | [
"MIT"
] | 1 | 2022-03-19T03:49:34.000Z | 2022-03-19T03:49:34.000Z | web3/providers/eth_tester/middleware.py | ayushkumar63123/web3.py | 4dda2db9d27a409f1a9c2b4a8ec917b53c51383f | [
"MIT"
] | null | null | null | web3/providers/eth_tester/middleware.py | ayushkumar63123/web3.py | 4dda2db9d27a409f1a9c2b4a8ec917b53c51383f | [
"MIT"
] | 1 | 2021-11-12T00:38:42.000Z | 2021-11-12T00:38:42.000Z | import operator
from typing import (
TYPE_CHECKING,
Any,
Callable,
)
from eth_typing import (
ChecksumAddress,
)
from eth_utils import (
is_dict,
is_hex,
is_string,
)
from eth_utils.curried import (
apply_formatter_if,
apply_formatters_to_dict,
)
from eth_utils.toolz import (
as... | 31.119874 | 100 | 0.693259 | import operator
from typing import (
TYPE_CHECKING,
Any,
Callable,
)
from eth_typing import (
ChecksumAddress,
)
from eth_utils import (
is_dict,
is_hex,
is_string,
)
from eth_utils.curried import (
apply_formatter_if,
apply_formatters_to_dict,
)
from eth_utils.toolz import (
as... | true | true |
f72fc26e54686c0677dd432b4718786ee33861af | 188 | py | Python | toal/annotators/WebAnnotators.py | Bhaskers-Blu-Org1/text-oriented-active-learning | facfb40673a59e43391b7bdb508e612dff1988d9 | [
"MIT"
] | 4 | 2020-10-23T14:42:30.000Z | 2021-06-10T13:29:04.000Z | toal/annotators/WebAnnotators.py | Bhaskers-Blu-Org1/text-oriented-active-learning | facfb40673a59e43391b7bdb508e612dff1988d9 | [
"MIT"
] | null | null | null | toal/annotators/WebAnnotators.py | Bhaskers-Blu-Org1/text-oriented-active-learning | facfb40673a59e43391b7bdb508e612dff1988d9 | [
"MIT"
] | 1 | 2020-07-30T10:35:09.000Z | 2020-07-30T10:35:09.000Z | from .AbstractAnnotator import AbstractAnnotator
class WebAnnotator(AbstractAnnotator):
def annotate(self, unlab_index, unlabeled_x, unlabeled_y):
raise NotImplementedError() | 31.333333 | 62 | 0.797872 | from .AbstractAnnotator import AbstractAnnotator
class WebAnnotator(AbstractAnnotator):
def annotate(self, unlab_index, unlabeled_x, unlabeled_y):
raise NotImplementedError() | true | true |
f72fc3c32c354207da9306ce6997164be7d90d1b | 9,544 | py | Python | venv/lib/python3.8/site-packages/awscli/customizations/eks/kubeconfig.py | sr9dc/DS_Systems_Project_2 | 0b348c1dd300756f732b4ce13e04239036dc601a | [
"MIT"
] | 4 | 2022-01-07T13:37:33.000Z | 2022-03-31T03:21:17.000Z | venv/lib/python3.8/site-packages/awscli/customizations/eks/kubeconfig.py | sr9dc/DS_Systems_Project_2 | 0b348c1dd300756f732b4ce13e04239036dc601a | [
"MIT"
] | 1 | 2022-01-27T04:21:58.000Z | 2022-01-27T04:21:58.000Z | venv/lib/python3.8/site-packages/awscli/customizations/eks/kubeconfig.py | sr9dc/DS_Systems_Project_2 | 0b348c1dd300756f732b4ce13e04239036dc601a | [
"MIT"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 34.454874 | 83 | 0.585813 |
import os
import yaml
import logging
import errno
from botocore.compat import OrderedDict
from awscli.customizations.eks.exceptions import EKSError
from awscli.customizations.eks.ordered_yaml import (ordered_yaml_load,
ordered_yaml_dump)
class KubeconfigError(EKSE... | true | true |
f72fc4014791e9cb00ad25357fa03b020d005be5 | 8,006 | py | Python | mxdc/devices/cryojet.py | michel4j/mxdc | 844f0854cc696553c8a51f8e9b5b06a8e4345261 | [
"BSD-3-Clause"
] | 2 | 2018-10-23T19:05:40.000Z | 2021-03-18T20:06:32.000Z | mxdc/devices/cryojet.py | michel4j/mxdc | 844f0854cc696553c8a51f8e9b5b06a8e4345261 | [
"BSD-3-Clause"
] | null | null | null | mxdc/devices/cryojet.py | michel4j/mxdc | 844f0854cc696553c8a51f8e9b5b06a8e4345261 | [
"BSD-3-Clause"
] | null | null | null | from enum import Enum
from gi.repository import GLib
from zope.interface import implementer
import mxdc.devices.shutter
from mxdc import Device, Signal, Property
from mxdc.devices import misc
from mxdc.utils.log import get_module_logger
from .interfaces import ICryostat
logger = get_module_logger(__name__)
class C... | 33.923729 | 103 | 0.62066 | from enum import Enum
from gi.repository import GLib
from zope.interface import implementer
import mxdc.devices.shutter
from mxdc import Device, Signal, Property
from mxdc.devices import misc
from mxdc.utils.log import get_module_logger
from .interfaces import ICryostat
logger = get_module_logger(__name__)
class C... | true | true |
f72fc514b8852f9e17acbed322e8818424cb6190 | 59,548 | py | Python | test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py | amrElroumy/autorest.python | b37af1779f6d53b4fa0d92da62151f8133006f98 | [
"MIT"
] | null | null | null | test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py | amrElroumy/autorest.python | b37af1779f6d53b4fa0d92da62151f8133006f98 | [
"MIT"
] | null | null | null | test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations/_paging_operations.py | amrElroumy/autorest.python | b37af1779f6d53b4fa0d92da62151f8133006f98 | [
"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.983884 | 140 | 0.653171 | from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
map_er... | true | true |
f72fc59c0d562a760978fca715dfabbc90935136 | 791 | pyde | Python | mode/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pyde | timgates42/processing.py | 78a237922c2a928b83f4ad579dbf8d32c0099890 | [
"Apache-2.0"
] | 1,224 | 2015-01-01T22:09:23.000Z | 2022-03-29T19:43:56.000Z | mode/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pyde | timgates42/processing.py | 78a237922c2a928b83f4ad579dbf8d32c0099890 | [
"Apache-2.0"
] | 253 | 2015-01-14T03:45:51.000Z | 2022-02-08T01:18:19.000Z | mode/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pyde | timgates42/processing.py | 78a237922c2a928b83f4ad579dbf8d32c0099890 | [
"Apache-2.0"
] | 225 | 2015-01-13T18:38:33.000Z | 2022-03-30T20:27:39.000Z |
"""
PrimitivePShape.
Using a PShape to display a custom polygon.
"""
def setup():
size(640, 360, P2D)
smooth()
# First create the shape.
global star
star = createShape()
star.beginShape()
# You can set fill and stroke.
star.fill(102)
star.stroke(255)
star.strokeWeight(2)
... | 19.775 | 51 | 0.610619 |
def setup():
size(640, 360, P2D)
smooth()
global star
star = createShape()
star.beginShape()
star.fill(102)
star.stroke(255)
star.strokeWeight(2)
star.vertex(0, -50)
star.vertex(14, -20)
star.vertex(47, -15)
star.vertex(23, 7)
star.vertex(29, 40)
sta... | true | true |
f72fc60681e9156e8be7417e9e0e510cbc1a4913 | 7,388 | py | Python | faucet/faucet_pipeline.py | boldsort/faucet | 451fbaa8ebce1822e06615c9da947f1dc7e3e416 | [
"Apache-2.0"
] | 3 | 2021-04-07T19:10:12.000Z | 2021-12-30T17:11:14.000Z | faucet/faucet_pipeline.py | boldsort/faucet | 451fbaa8ebce1822e06615c9da947f1dc7e3e416 | [
"Apache-2.0"
] | 27 | 2019-03-22T03:44:20.000Z | 2020-01-19T16:53:55.000Z | faucet/faucet_pipeline.py | boldsort/faucet | 451fbaa8ebce1822e06615c9da947f1dc7e3e416 | [
"Apache-2.0"
] | 1 | 2019-10-25T22:51:42.000Z | 2019-10-25T22:51:42.000Z | """Standard FAUCET pipeline."""
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2019 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file... | 34.362791 | 93 | 0.678668 |
from faucet.faucet_metadata import EGRESS_METADATA_MASK
class ValveTableConfig:
def __init__(self, name, table_id, exact_match=None, meter=None, output=True, miss_goto=None,
size=None, match_types=None, set_fields=None, dec_ttl=None,
vlan_scale=None, vlan_port... | true | true |
f72fc60aecfcd841a19625037bc8f38fa6921303 | 30,717 | py | Python | models/tests/test_dataio.py | endymecy/NDIToolbox | f7a0a642b4a778d9d0c131871f4bfb9822ecb3da | [
"BSD-4-Clause"
] | 5 | 2017-02-28T16:16:06.000Z | 2020-07-13T06:49:34.000Z | models/tests/test_dataio.py | endymecy/NDIToolbox | f7a0a642b4a778d9d0c131871f4bfb9822ecb3da | [
"BSD-4-Clause"
] | 1 | 2018-08-19T19:08:14.000Z | 2018-08-19T19:08:14.000Z | models/tests/test_dataio.py | endymecy/NDIToolbox | f7a0a642b4a778d9d0c131871f4bfb9822ecb3da | [
"BSD-4-Clause"
] | 4 | 2017-10-25T20:17:15.000Z | 2021-07-26T11:39:50.000Z | """test_dataio.py - tests the dataio module
Chris R. Coughlin (TRI/Austin, Inc.)
"""
__author__ = 'Chris R. Coughlin'
import unittest
from models import dataio
from controllers import pathfinder
from utils.skiptest import skipIfModuleNotInstalled
import h5py
import numpy as np
import numpy.testing
import scipy.misc
... | 51.799325 | 126 | 0.624442 |
__author__ = 'Chris R. Coughlin'
import unittest
from models import dataio
from controllers import pathfinder
from utils.skiptest import skipIfModuleNotInstalled
import h5py
import numpy as np
import numpy.testing
import scipy.misc
import os
import random
class TestDataIO(unittest.TestCase):
def setUp(self):
... | true | true |
f72fca48a62d8d293aa54c0897823b567e43a32a | 2,008 | py | Python | tests/test_RunningStats.py | gratuxri/play-chess-with-a-webcam | 9ef7ec306a2a612871fba83130ebee1f044ef0c1 | [
"Apache-2.0"
] | 17 | 2019-10-25T01:33:43.000Z | 2022-03-21T03:31:56.000Z | tests/test_RunningStats.py | gratuxri/play-chess-with-a-webcam | 9ef7ec306a2a612871fba83130ebee1f044ef0c1 | [
"Apache-2.0"
] | 34 | 2019-10-17T06:52:30.000Z | 2022-01-19T12:45:43.000Z | tests/test_RunningStats.py | gratuxri/play-chess-with-a-webcam | 9ef7ec306a2a612871fba83130ebee1f044ef0c1 | [
"Apache-2.0"
] | 4 | 2019-11-29T09:19:38.000Z | 2021-10-13T03:12:25.000Z | #!/usr/bin/python3
# part of https://github.com/WolfgangFahl/play-chess-with-a-webcam
from pcwawc.runningstats import RunningStats, ColorStats, MovingAverage
import pytest
from unittest import TestCase
class RunningStatsTest(TestCase):
def test_RunningStats(self):
rs = RunningStats()
rs.push(1... | 36.509091 | 103 | 0.556275 | from pcwawc.runningstats import RunningStats, ColorStats, MovingAverage
import pytest
from unittest import TestCase
class RunningStatsTest(TestCase):
def test_RunningStats(self):
rs = RunningStats()
rs.push(17.0);
rs.push(19.0);
rs.push(24.0);
mean = rs.mean();
... | true | true |
f72fcbddac8b795d0d38b329417686484d875719 | 2,006 | py | Python | jabberbot/_tests/test_capat.py | RealTimeWeb/wikisite | 66a22c68c172f0ebb3c88a9885ccd33e2d59c3c5 | [
"Apache-2.0"
] | null | null | null | jabberbot/_tests/test_capat.py | RealTimeWeb/wikisite | 66a22c68c172f0ebb3c88a9885ccd33e2d59c3c5 | [
"Apache-2.0"
] | null | null | null | jabberbot/_tests/test_capat.py | RealTimeWeb/wikisite | 66a22c68c172f0ebb3c88a9885ccd33e2d59c3c5 | [
"Apache-2.0"
] | 1 | 2020-01-09T04:53:32.000Z | 2020-01-09T04:53:32.000Z | # -*- coding: utf-8 -*-
import py
try:
from jabberbot import capat
except ImportError:
py.test.skip("Skipping jabber bot tests - pyxmpp is not installed")
def test_ver_simple():
# example values supplied by the XEP
ident = (("client", "pc"), )
feat = ("http://jabber.org/protocol/disco#info",
... | 34.586207 | 76 | 0.612164 |
import py
try:
from jabberbot import capat
except ImportError:
py.test.skip("Skipping jabber bot tests - pyxmpp is not installed")
def test_ver_simple():
ident = (("client", "pc"), )
feat = ("http://jabber.org/protocol/disco#info",
"http://jabber.org/protocol/disco#items",
... | true | true |
f72fcdb0009d66ce95554b101bd82a076188d8f3 | 1,140 | py | Python | where_to_go/places/models.py | MZen2610/Yandex-poster | 07b1e44974783563c394b22625aa2543d74552f9 | [
"MIT"
] | null | null | null | where_to_go/places/models.py | MZen2610/Yandex-poster | 07b1e44974783563c394b22625aa2543d74552f9 | [
"MIT"
] | null | null | null | where_to_go/places/models.py | MZen2610/Yandex-poster | 07b1e44974783563c394b22625aa2543d74552f9 | [
"MIT"
] | null | null | null | from django.db import models
class Place(models.Model):
title = models.CharField(max_length=150, verbose_name='Наименование')
description_short = models.TextField(blank=True, verbose_name='Краткое описание')
description_long = models.TextField(blank=True, verbose_name='Полное описание')
lng = models.D... | 35.625 | 111 | 0.7 | from django.db import models
class Place(models.Model):
title = models.CharField(max_length=150, verbose_name='Наименование')
description_short = models.TextField(blank=True, verbose_name='Краткое описание')
description_long = models.TextField(blank=True, verbose_name='Полное описание')
lng = models.D... | true | true |
f72fcde236c44645e86f524db09b26ce3bfb931b | 3,649 | py | Python | server/core.py | cwza/deep_t2i | 22877fdd28ad407984ddc3bc4d57109c54c22fc0 | [
"Apache-2.0"
] | null | null | null | server/core.py | cwza/deep_t2i | 22877fdd28ad407984ddc3bc4d57109c54c22fc0 | [
"Apache-2.0"
] | null | null | null | server/core.py | cwza/deep_t2i | 22877fdd28ad407984ddc3bc4d57109c54c22fc0 | [
"Apache-2.0"
] | 1 | 2020-11-30T06:11:02.000Z | 2020-11-30T06:11:02.000Z | import os
from pathlib import Path
import numpy as np
from PIL import Image
import requests
from google.cloud import storage
import base64
from io import BytesIO
import uuid
__all__ = ['do', 'recaptcha_check']
def predict_and2jpg(model, cap):
''' cap: "white hair yellow eyes", returns: jpeg file buffer remember t... | 34.424528 | 101 | 0.698822 | import os
from pathlib import Path
import numpy as np
from PIL import Image
import requests
from google.cloud import storage
import base64
from io import BytesIO
import uuid
__all__ = ['do', 'recaptcha_check']
def predict_and2jpg(model, cap):
img, _ = model.predict(cap)
img = Image.fromarray(np.uint8(img.nump... | true | true |
f72fce083693b057598af0c60439146c9ccc930a | 1,461 | py | Python | Task2D.py | dan7267/1a-flood-risk-project-93 | d95cee987f5673d637626e1804f719371a25daa8 | [
"MIT"
] | null | null | null | Task2D.py | dan7267/1a-flood-risk-project-93 | d95cee987f5673d637626e1804f719371a25daa8 | [
"MIT"
] | null | null | null | Task2D.py | dan7267/1a-flood-risk-project-93 | d95cee987f5673d637626e1804f719371a25daa8 | [
"MIT"
] | null | null | null | # Copyright (C) 2018 Garth N. Wells
#
# SPDX-License-Identifier: MIT
import datetime
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.stationdata import build_station_list
def run():
"""Requirements for Task2D"""
# Build list of stations
stations = build_station_list()
# S... | 27.055556 | 75 | 0.659138 |
import datetime
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.stationdata import build_station_list
def run():
stations = build_station_list()
station_name = "Cam"
station_cam = None
for station in stations:
if station.name == station_name:
... | true | true |
f72fce4b9ca244110fc20c8066f330fd436dbac7 | 769 | py | Python | contacts/server/server.py | alfredoroblesa/contacts-tool | 7b9d9ddbaa3ac1f2fc1210aa11958043a79d2e05 | [
"MIT"
] | null | null | null | contacts/server/server.py | alfredoroblesa/contacts-tool | 7b9d9ddbaa3ac1f2fc1210aa11958043a79d2e05 | [
"MIT"
] | null | null | null | contacts/server/server.py | alfredoroblesa/contacts-tool | 7b9d9ddbaa3ac1f2fc1210aa11958043a79d2e05 | [
"MIT"
] | null | null | null | import os
import json
from flask import Flask, render_template
DATABASE_PATH = "../.contacts-store"
# Read database and build HTML string
file_names = os.listdir(DATABASE_PATH)
file_names.remove(".git")
html = "<table><th>Contact</th><th>Last Name</th><th>Tlf</th><th>Email</th><th>Job</th><th>Province</th>"
for file_... | 33.434783 | 174 | 0.654096 | import os
import json
from flask import Flask, render_template
DATABASE_PATH = "../.contacts-store"
file_names = os.listdir(DATABASE_PATH)
file_names.remove(".git")
html = "<table><th>Contact</th><th>Last Name</th><th>Tlf</th><th>Email</th><th>Job</th><th>Province</th>"
for file_name in file_names:
file_path = os... | true | true |
f72fcf78d29e01d35333b5634ff87c068a1f35d6 | 13,176 | py | Python | Networks/4_layer_net_Parameter_optimization.py | Kohulan/Decimer-Python | 17373e02faedb28ba94742f61001bb3c6b015798 | [
"MIT"
] | 5 | 2019-07-24T14:18:07.000Z | 2021-11-08T00:35:55.000Z | Networks/4_layer_net_Parameter_optimization.py | Kohulan/Decimer-Python | 17373e02faedb28ba94742f61001bb3c6b015798 | [
"MIT"
] | null | null | null | Networks/4_layer_net_Parameter_optimization.py | Kohulan/Decimer-Python | 17373e02faedb28ba94742f61001bb3c6b015798 | [
"MIT"
] | 5 | 2020-09-16T13:01:31.000Z | 2022-01-24T06:26:06.000Z | '''
* This Software is under the MIT License
* Refer to LICENSE or https://opensource.org/licenses/MIT for more information
* Written by Kohulan Rajan
* © 2019
'''
#Parallelized datareading network
import tensorflow as tf
import os
import sys
import numpy as np
import matplotlib as mpl
import csv
mpl... | 41.046729 | 245 | 0.652095 |
import tensorflow as tf
import os
import sys
import numpy as np
import matplotlib as mpl
import csv
mpl.use('Agg')
import matplotlib.pyplot as plt
from datetime import datetime
from numpy import array
import pickle
import lz4.frame as lz
import multiprocessing
np.set_printoptions(threshold=np.nan)
os.... | true | true |
f72fcf8390be1f9d3facd1c0666a534992e527a7 | 10,916 | py | Python | tensorflow_quantum/core/ops/batch_util_test.py | PyJedi/quantum | 3f4a3c320e048b8a8faf3a10339975d2d5366fb6 | [
"Apache-2.0"
] | 1 | 2020-06-01T01:28:36.000Z | 2020-06-01T01:28:36.000Z | tensorflow_quantum/core/ops/batch_util_test.py | PyJedi/quantum | 3f4a3c320e048b8a8faf3a10339975d2d5366fb6 | [
"Apache-2.0"
] | null | null | null | tensorflow_quantum/core/ops/batch_util_test.py | PyJedi/quantum | 3f4a3c320e048b8a8faf3a10339975d2d5366fb6 | [
"Apache-2.0"
] | 1 | 2020-06-07T01:28:01.000Z | 2020-06-07T01:28:01.000Z | # Copyright 2020 The TensorFlow Quantum 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... | 39.839416 | 80 | 0.600861 | import numpy as np
import tensorflow as tf
from absl.testing import parameterized
from scipy import stats
import cirq
from tensorflow_quantum.core.ops import batch_util
from tensorflow_quantum.python import util
BATCH_SIZE = 12
N_QUBITS = 5
PAULI_LENGTH = 3
SYMBOLS = ['alpha', 'beta', 'gamma']
def _get_mixed_batch(... | true | true |
f72fcf8e506902e300f338f0524ddabfe7e97eb9 | 13,031 | py | Python | watertap/core/zero_order_properties.py | jalving/watertap | a89bd61deaaca9c30402727545e8223a276c93e6 | [
"BSD-3-Clause-LBNL"
] | null | null | null | watertap/core/zero_order_properties.py | jalving/watertap | a89bd61deaaca9c30402727545e8223a276c93e6 | [
"BSD-3-Clause-LBNL"
] | null | null | null | watertap/core/zero_order_properties.py | jalving/watertap | a89bd61deaaca9c30402727545e8223a276c93e6 | [
"BSD-3-Clause-LBNL"
] | null | null | null | ###############################################################################
# WaterTAP Copyright (c) 2021, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National
# Laboratory, National Renewable Energy Laboratory, and National Energy
# Technology Laboratory ... | 39.728659 | 81 | 0.578927 | from idaes.core import (EnergyBalanceType,
MaterialBalanceType,
MaterialFlowBasis,
PhysicalParameterBlock,
StateBlock,
StateBlockData,
declare_process_block_class)
from idaes.c... | true | true |
f72fcfcd3dc525e47916c5740040252f6d957d98 | 5,279 | py | Python | py/jupyterlite/src/jupyterlite/config.py | marimeireles/jupyterlite | 65c9304cf89d311b8a48f227a0cbb2b7f50cf4bd | [
"BSD-3-Clause"
] | null | null | null | py/jupyterlite/src/jupyterlite/config.py | marimeireles/jupyterlite | 65c9304cf89d311b8a48f227a0cbb2b7f50cf4bd | [
"BSD-3-Clause"
] | null | null | null | py/jupyterlite/src/jupyterlite/config.py | marimeireles/jupyterlite | 65c9304cf89d311b8a48f227a0cbb2b7f50cf4bd | [
"BSD-3-Clause"
] | null | null | null | """an observable configuration object for the JupyterLite lifecycle
.. todo::
Move to a canonical JSON schema?
"""
import os
from pathlib import Path
from typing import Optional as _Optional
from typing import Text as _Text
from typing import Tuple as _Tuple
from traitlets import CInt, Tuple, Unicode, default
f... | 29.327778 | 87 | 0.614321 | import os
from pathlib import Path
from typing import Optional as _Optional
from typing import Text as _Text
from typing import Tuple as _Tuple
from traitlets import CInt, Tuple, Unicode, default
from traitlets.config import LoggingConfigurable
from . import constants as C
from .trait_types import CPath, TypedTuple
... | true | true |
f72fcfd6c1a73e3ebdb2254eb93485dc7e9e2ac2 | 10,495 | py | Python | tests/test_expressions.py | thorag76/mappyfile | 51ae914cb6282549b73cde684cbc54e213c74d4a | [
"MIT"
] | 48 | 2017-02-07T23:37:37.000Z | 2021-12-28T12:56:37.000Z | tests/test_expressions.py | thorag76/mappyfile | 51ae914cb6282549b73cde684cbc54e213c74d4a | [
"MIT"
] | 135 | 2017-03-16T08:54:59.000Z | 2022-03-30T20:00:22.000Z | tests/test_expressions.py | thorag76/mappyfile | 51ae914cb6282549b73cde684cbc54e213c74d4a | [
"MIT"
] | 23 | 2017-01-31T08:46:48.000Z | 2021-07-08T15:28:49.000Z | # -*- coding: utf-8 -*-
import logging
import json
import inspect
import pytest
from mappyfile.parser import Parser
from mappyfile.pprint import PrettyPrinter
from mappyfile.transformer import MapfileToDict
def output(s):
"""
Parse, transform, and pretty print
the result
"""
p = Parser()
m = M... | 22.765727 | 120 | 0.577608 | import logging
import json
import inspect
import pytest
from mappyfile.parser import Parser
from mappyfile.pprint import PrettyPrinter
from mappyfile.transformer import MapfileToDict
def output(s):
p = Parser()
m = MapfileToDict(include_position=True)
logging.info(inspect.stack()[1][3])
ast = p.... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.