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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f744519e430c701264a0ebb05fc3d33ac75ed3e2 | 2,483 | py | Python | homeassistant/components/switch/ihc.py | Stubbs/home-assistant | 37fd438717e1112ff8979138a72b7f5c068f5e35 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/switch/ihc.py | Stubbs/home-assistant | 37fd438717e1112ff8979138a72b7f5c068f5e35 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/switch/ihc.py | Stubbs/home-assistant | 37fd438717e1112ff8979138a72b7f5c068f5e35 | [
"Apache-2.0"
] | null | null | null | """IHC switch platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.ihc/
"""
import voluptuous as vol
from homeassistant.components.ihc import (
validate_name, IHC_DATA, IHC_CONTROLLER, IHC_INFO)
from homeassistant.components.ihc.ihcdevice... | 32.671053 | 75 | 0.65888 | import voluptuous as vol
from homeassistant.components.ihc import (
validate_name, IHC_DATA, IHC_CONTROLLER, IHC_INFO)
from homeassistant.components.ihc.ihcdevice import IHCDevice
from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA
from homeassistant.const import CONF_ID, CONF_NAME, CONF_SWIT... | true | true |
f74451d1fe01677bb52ec36545845ca03385c788 | 7,264 | py | Python | keras/optimizer_v2/adamax.py | Halo9Pan/dive-keras | 7d4c5572fa3a9fc2542a1314d06c555f67575cb0 | [
"Apache-2.0"
] | 37,222 | 2017-12-13T00:52:55.000Z | 2022-03-31T22:34:35.000Z | keras/optimizer_v2/adamax.py | amirsadafi/keras | f1e9c76675981ee6683f54a3ce569212d551d12d | [
"Apache-2.0"
] | 7,624 | 2017-12-13T01:03:40.000Z | 2022-03-31T23:57:24.000Z | keras/optimizer_v2/adamax.py | amirsadafi/keras | f1e9c76675981ee6683f54a3ce569212d551d12d | [
"Apache-2.0"
] | 14,914 | 2017-12-13T02:30:46.000Z | 2022-03-30T14:49:16.000Z | # Copyright 2018 The TensorFlow 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 applica... | 40.355556 | 80 | 0.674559 |
import tensorflow.compat.v2 as tf
from keras import backend_config
from keras.optimizer_v2 import optimizer_v2
from tensorflow.python.util.tf_export import keras_export
@keras_export('keras.optimizers.Adamax')
class Adamax(optimizer_v2.OptimizerV2):
_HAS_AGGREGATE_GRAD = True
def __init__(self,
... | true | true |
f7445230bb8d492059dd6baab8f5d33113caf45c | 1,703 | py | Python | tests/contrib/test_vacs.py | jvazquez77/marvin | f7f2c498c1a2cfa19ab96c51eebbbd4bde980984 | [
"BSD-3-Clause"
] | 49 | 2016-11-04T19:20:50.000Z | 2022-03-13T08:43:05.000Z | tests/contrib/test_vacs.py | jvazquez77/marvin | f7f2c498c1a2cfa19ab96c51eebbbd4bde980984 | [
"BSD-3-Clause"
] | 703 | 2016-11-02T01:25:14.000Z | 2022-03-31T19:20:03.000Z | tests/contrib/test_vacs.py | jvazquez77/marvin | f7f2c498c1a2cfa19ab96c51eebbbd4bde980984 | [
"BSD-3-Clause"
] | 37 | 2016-11-09T08:51:48.000Z | 2022-02-22T22:49:45.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @Author: José Sánchez-Gallego (gallegoj@uw.edu)
# @Date: 2018-07-08
# @Filename: vacs.py
# @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause)
#
# @Last modified by: Brian Cherinka
# @Last modified time: 2018-07-09 17:27:59
import importlib
impor... | 26.2 | 90 | 0.648855 |
import importlib
import astropy.io.fits
import pytest
from marvin.contrib.vacs import VACMixIn
from marvin.tools.maps import Maps
class TestVACs(object):
def test_subclasses(self):
assert len(VACMixIn.__subclasses__()) > 0
def test_mangahi(self):
my_map = Maps('7443-12701')
... | true | true |
f7445301614e506bb403688cd592a5d9d833dd18 | 2,524 | py | Python | tests/util/filesystem_base.py | adoroszlai/impala | ea13e744977c71206c11a54f65d77aeecb55703d | [
"Apache-2.0"
] | 746 | 2017-12-02T06:02:05.000Z | 2022-03-29T06:59:03.000Z | tests/util/filesystem_base.py | xwzbupt/impala | 97dda2b27da99367f4d07699aa046b16cda16dd4 | [
"Apache-2.0"
] | 9 | 2018-01-30T16:16:22.000Z | 2021-08-31T00:13:28.000Z | tests/util/filesystem_base.py | xwzbupt/impala | 97dda2b27da99367f4d07699aa046b16cda16dd4 | [
"Apache-2.0"
] | 363 | 2017-12-10T01:08:17.000Z | 2022-03-26T05:25:00.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.055556 | 88 | 0.727813 |
from abc import ABCMeta, abstractmethod
class BaseFilesystem(object):
__metaclass__ = ABCMeta
@abstractmethod
def create_file(self, path, file_data, overwrite):
pass
@abstractmethod
def make_dir(self, path, permission):
pass
@abstractmethod
def copy(self, src, dst, overwrite... | true | true |
f744537117734f0402bb16e21b000647449c91aa | 2,832 | py | Python | subscribe.py | Ermaotie/Q-A-Robot | c07e6ad601aa9eea2db6f657b260ab1b4df4d5c2 | [
"MIT"
] | null | null | null | subscribe.py | Ermaotie/Q-A-Robot | c07e6ad601aa9eea2db6f657b260ab1b4df4d5c2 | [
"MIT"
] | 2 | 2020-06-16T13:10:51.000Z | 2020-09-11T14:48:55.000Z | subscribe.py | Ermaotie/Q-A-Robot | c07e6ad601aa9eea2db6f657b260ab1b4df4d5c2 | [
"MIT"
] | null | null | null | import requests
import json
import pymongo
import werobot
from requests import request
url = "http://jw.scut.edu.cn/zhinan/cms/article/v2/findInformNotice.do"
payload = 'category=0&tag=0&pageNum=1&pageSize=15&keyword='
headers = {
'Referer': 'http://jw.scut.edu.cn/zhinan/cms/toPosts.do',
'Content-Type': 'applicat... | 26.716981 | 128 | 0.638418 | import requests
import json
import pymongo
import werobot
from requests import request
url = "http://jw.scut.edu.cn/zhinan/cms/article/v2/findInformNotice.do"
payload = 'category=0&tag=0&pageNum=1&pageSize=15&keyword='
headers = {
'Referer': 'http://jw.scut.edu.cn/zhinan/cms/toPosts.do',
'Content-Type': 'applicat... | true | true |
f744542d23f6b8b2b086b3b024f2a2c8e680e295 | 1,081 | py | Python | lambda/main.py | helionagamachi/S3Share | 145b3043d3830d0692d4450149ba1bfad41af61a | [
"Apache-2.0"
] | null | null | null | lambda/main.py | helionagamachi/S3Share | 145b3043d3830d0692d4450149ba1bfad41af61a | [
"Apache-2.0"
] | null | null | null | lambda/main.py | helionagamachi/S3Share | 145b3043d3830d0692d4450149ba1bfad41af61a | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timedelta
import jwt
key = "#KEY_TO_BE_REPLACED#"
def handler(event, context):
if event.get('Records') is not None:
return process_cf_request(event)
return generate_token(event)
def generate_token(event):
uri = event['uri']
if uri[0] is not '/':
uri =... | 25.139535 | 75 | 0.580019 | from datetime import datetime, timedelta
import jwt
key = "#KEY_TO_BE_REPLACED#"
def handler(event, context):
if event.get('Records') is not None:
return process_cf_request(event)
return generate_token(event)
def generate_token(event):
uri = event['uri']
if uri[0] is not '/':
uri =... | true | true |
f7445437f1dec650b636665e693dd3a2338ab3d4 | 362 | py | Python | glow/test/test_timer.py | arquolo/ort | 6f2d32d739ed6a0dab81bb91018c005e47ef7e77 | [
"MIT"
] | null | null | null | glow/test/test_timer.py | arquolo/ort | 6f2d32d739ed6a0dab81bb91018c005e47ef7e77 | [
"MIT"
] | null | null | null | glow/test/test_timer.py | arquolo/ort | 6f2d32d739ed6a0dab81bb91018c005e47ef7e77 | [
"MIT"
] | null | null | null | from itertools import islice
from tqdm.auto import tqdm
import glow
def iter_fibs():
prev, cur = 0, 1
while True:
prev, cur = cur, prev + cur
yield cur
@glow.time_this
def fibs(n):
gen = islice(iter_fibs(), n)
gen = tqdm(gen)
return max(x.bit_length() for x in gen)
def test_f... | 15.083333 | 43 | 0.624309 | from itertools import islice
from tqdm.auto import tqdm
import glow
def iter_fibs():
prev, cur = 0, 1
while True:
prev, cur = cur, prev + cur
yield cur
@glow.time_this
def fibs(n):
gen = islice(iter_fibs(), n)
gen = tqdm(gen)
return max(x.bit_length() for x in gen)
def test_f... | true | true |
f7445489f9ef18d66c931eacf66afa78724000e5 | 2,348 | py | Python | keras_cv/layers/preprocessing/random_sharpness_test.py | kartik4949/keras-cv | 4c300f564d8ec99cd1351c445e1803ee6664915a | [
"Apache-2.0"
] | null | null | null | keras_cv/layers/preprocessing/random_sharpness_test.py | kartik4949/keras-cv | 4c300f564d8ec99cd1351c445e1803ee6664915a | [
"Apache-2.0"
] | null | null | null | keras_cv/layers/preprocessing/random_sharpness_test.py | kartik4949/keras-cv | 4c300f564d8ec99cd1351c445e1803ee6664915a | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 The KerasCV 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 32.611111 | 79 | 0.496167 |
import tensorflow as tf
from keras_cv.layers import preprocessing
class RandomSharpnessTest(tf.test.TestCase):
def test_random_sharpness_preserves_output_shape(self):
img_shape = (50, 50, 3)
xs = tf.stack(
[2 * tf.ones(img_shape), tf.ones(img_shape)],
axis=0,
... | true | true |
f74456de7e6f3996fe013a1e2941e5a355340b10 | 1,008 | py | Python | lightbus/utilities/django.py | adamcharnock/lightbus | 5e7069da06cd37a8131e8c592ee957ccb73603d5 | [
"Apache-2.0"
] | 178 | 2017-07-22T12:35:00.000Z | 2022-03-28T07:53:13.000Z | lightbus/utilities/django.py | adamcharnock/warren | 5e7069da06cd37a8131e8c592ee957ccb73603d5 | [
"Apache-2.0"
] | 26 | 2017-08-03T12:09:29.000Z | 2021-10-19T16:47:18.000Z | lightbus/utilities/django.py | adamcharnock/warren | 5e7069da06cd37a8131e8c592ee957ccb73603d5 | [
"Apache-2.0"
] | 19 | 2017-09-15T17:51:24.000Z | 2022-02-28T13:00:16.000Z | from functools import wraps
def uses_django_db(f):
"""Ensures Django discards any broken database connections
Django normally cleans up connections once a web request has
been processed. However, here we are not serving web requests
and are outside of Django's request handling logic. We therefore
... | 32.516129 | 75 | 0.693452 | from functools import wraps
def uses_django_db(f):
from django.db import reset_queries, close_old_connections
@wraps(f)
def wrapped(*args, **kwargs):
reset_queries()
close_old_connections()
try:
return f(*args, **kwargs)
finally:
... | true | true |
f74456ed626744e35f8787b42d4675816f429370 | 138 | py | Python | profiles_api/admin.py | TalganKumarRao/profiles-rest-api | d3726651c79bdf334f5f4ee459c9ae825ddd272c | [
"MIT"
] | null | null | null | profiles_api/admin.py | TalganKumarRao/profiles-rest-api | d3726651c79bdf334f5f4ee459c9ae825ddd272c | [
"MIT"
] | 6 | 2020-06-06T01:44:42.000Z | 2021-06-10T20:02:47.000Z | profiles_api/admin.py | ShotaHirabayashi/profies-API | 5dcd37c554fc121cc296b67aa4a5f5606ce67f1b | [
"MIT"
] | null | null | null | from django.contrib import admin
from profiles_api import models
admin.site.register(models.UserProfile)
# Register your models here.
| 15.333333 | 39 | 0.811594 | from django.contrib import admin
from profiles_api import models
admin.site.register(models.UserProfile)
| true | true |
f744580853ac0dc47dbf987d1497464099a8f500 | 1,907 | py | Python | tests/test-checkbox.py | JonathanRRogers/twill | e1afc10366dcd29b82eeae2d586e49ca7737039a | [
"MIT"
] | null | null | null | tests/test-checkbox.py | JonathanRRogers/twill | e1afc10366dcd29b82eeae2d586e49ca7737039a | [
"MIT"
] | null | null | null | tests/test-checkbox.py | JonathanRRogers/twill | e1afc10366dcd29b82eeae2d586e49ca7737039a | [
"MIT"
] | null | null | null | import twilltestlib
import twill
from twill import namespaces, commands
from twill.errors import TwillAssertionError
from mechanize import BrowserStateError
def setup_module():
global url
url = twilltestlib.get_url()
def test_select_multiple():
namespaces.new_local_dict()
twill.commands.reset_browser(... | 26.859155 | 77 | 0.631358 | import twilltestlib
import twill
from twill import namespaces, commands
from twill.errors import TwillAssertionError
from mechanize import BrowserStateError
def setup_module():
global url
url = twilltestlib.get_url()
def test_select_multiple():
namespaces.new_local_dict()
twill.commands.reset_browser(... | true | true |
f7445837e36651ae118744a6f5648c2784f49077 | 4,463 | py | Python | replay/compare_plots.py | ezvk7740/robotics-rl-srl | aad209d6edd1bf28d886132fecd0e503d2a7af93 | [
"MIT"
] | 1 | 2020-05-24T11:24:33.000Z | 2020-05-24T11:24:33.000Z | replay/compare_plots.py | GrazyThinking/robotics-rl-srl | aad209d6edd1bf28d886132fecd0e503d2a7af93 | [
"MIT"
] | null | null | null | replay/compare_plots.py | GrazyThinking/robotics-rl-srl | aad209d6edd1bf28d886132fecd0e503d2a7af93 | [
"MIT"
] | 1 | 2019-12-29T23:43:39.000Z | 2019-12-29T23:43:39.000Z | import argparse
import os
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from matplotlib.ticker import FuncFormatter
from replay.aggregate_plots import lightcolors, darkcolors, Y_LIM_SHAPED_REWARD, Y_LIM_SPARSE_REWARD, millions
from srl_zoo.utils import printGreen, printRed
# Init seaborn
s... | 39.149123 | 119 | 0.645754 | import argparse
import os
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from matplotlib.ticker import FuncFormatter
from replay.aggregate_plots import lightcolors, darkcolors, Y_LIM_SHAPED_REWARD, Y_LIM_SPARSE_REWARD, millions
from srl_zoo.utils import printGreen, printRed
sns.set()
font... | true | true |
f74458ce9976d8bd17098f7fa4ac3c2fac6e6b6b | 14,104 | py | Python | esppy/connectors/tervela.py | PetreStegaroiu/python-esppy | d43781e94ad9236916901eeb3737d0b1b18d797a | [
"Apache-2.0"
] | null | null | null | esppy/connectors/tervela.py | PetreStegaroiu/python-esppy | d43781e94ad9236916901eeb3737d0b1b18d797a | [
"Apache-2.0"
] | null | null | null | esppy/connectors/tervela.py | PetreStegaroiu/python-esppy | d43781e94ad9236916901eeb3737d0b1b18d797a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright SAS Institute
#
# 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 b... | 47.648649 | 82 | 0.642229 |
from __future__ import print_function, division, absolute_import, unicode_literals
import numbers
import re
import six
from .base import Connector, prop, map_properties
from ..utils import xml
from ..utils.data import gen_name
class TervelaSubscriber(Connector):
connector_key = dict(cls='terve... | true | true |
f74458ddff2b4e031598b7bc77cc91f97f48fa44 | 2,307 | py | Python | tests/test_imports.py | patel-zeel/pyprobml | 027ef3c13a2a63d958e05fdedb68fd7b8f0e0261 | [
"MIT"
] | null | null | null | tests/test_imports.py | patel-zeel/pyprobml | 027ef3c13a2a63d958e05fdedb68fd7b8f0e0261 | [
"MIT"
] | 1 | 2022-03-27T04:59:50.000Z | 2022-03-27T04:59:50.000Z | tests/test_imports.py | patel-zeel/pyprobml | 027ef3c13a2a63d958e05fdedb68fd7b8f0e0261 | [
"MIT"
] | 2 | 2022-03-26T11:52:36.000Z | 2022-03-27T05:17:48.000Z | import pytest
from glob import glob
import pkgutil
import nbformat
# Global variables
TIMEOUT = 120
# Load notebooks
notebooks1 = glob("notebooks/book1/*/*.ipynb")
notebooks2 = glob("notebooks/book2/*/*.ipynb")
notebooks = notebooks1 + notebooks2
#get IGNORE_LIST of notebooks
IGNORE_LIST = []
with open("internal/cop... | 28.8375 | 94 | 0.678804 | import pytest
from glob import glob
import pkgutil
import nbformat
TIMEOUT = 120
notebooks1 = glob("notebooks/book1/*/*.ipynb")
notebooks2 = glob("notebooks/book2/*/*.ipynb")
notebooks = notebooks1 + notebooks2
IGNORE_LIST = []
with open("internal/copied_from misc_nb.txt") as fp:
ignored_notebooks = fp.readli... | true | true |
f7445f4287a2ca1e3537f1dc1f2c87be8a25f652 | 3,377 | py | Python | libica/openapi/libconsole/models/workgroup_response.py | umccr-illumina/libica | 916d27eea499f29bee590268b84208effb0cc576 | [
"MIT"
] | null | null | null | libica/openapi/libconsole/models/workgroup_response.py | umccr-illumina/libica | 916d27eea499f29bee590268b84208effb0cc576 | [
"MIT"
] | 4 | 2021-11-15T10:47:51.000Z | 2022-02-22T04:43:20.000Z | libica/openapi/libconsole/models/workgroup_response.py | umccr-illumina/libica | 916d27eea499f29bee590268b84208effb0cc576 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Developer Console Service
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
impo... | 27.909091 | 124 | 0.580101 |
import pprint
import re
import six
from libica.openapi.libconsole.configuration import Configuration
class WorkgroupResponse(object):
openapi_types = {
'items': 'list[Workgroup]'
}
attribute_map = {
'items': 'items'
}
def __init__(self, items=None, local_vars_configurati... | true | true |
f7445fa9502fcc507adafa2344b62bffbbfd82ac | 473 | py | Python | etd_drop_app/validators.py | MetaArchive/etd-drop | a61ac2e96029ab35c029fe2616829b95a0fe4630 | [
"BSD-3-Clause"
] | 1 | 2019-05-17T13:54:41.000Z | 2019-05-17T13:54:41.000Z | etd_drop_app/validators.py | MetaArchive/etd-drop | a61ac2e96029ab35c029fe2616829b95a0fe4630 | [
"BSD-3-Clause"
] | null | null | null | etd_drop_app/validators.py | MetaArchive/etd-drop | a61ac2e96029ab35c029fe2616829b95a0fe4630 | [
"BSD-3-Clause"
] | null | null | null | from django.core.exceptions import ValidationError
import magic
class MimetypeValidator(object):
def __init__(self, mimetypes):
self.mimetypes = mimetypes
def __call__(self, value):
try:
mime = magic.from_buffer(value.read(1024), mime=True)
if not mime in self.mimetypes:
raise ValidationError('%s is... | 29.5625 | 83 | 0.752643 | from django.core.exceptions import ValidationError
import magic
class MimetypeValidator(object):
def __init__(self, mimetypes):
self.mimetypes = mimetypes
def __call__(self, value):
try:
mime = magic.from_buffer(value.read(1024), mime=True)
if not mime in self.mimetypes:
raise ValidationError('%s is... | true | true |
f7445fd8b06747833dfc59e059f11915755551a1 | 2,487 | py | Python | ppci/arch/isa.py | kl4w3i/ppci | f3be0d4ebc1ac57907fd9c21e886ab70b2805c21 | [
"BSD-2-Clause"
] | 161 | 2020-05-31T03:29:42.000Z | 2022-03-07T08:36:19.000Z | ppci/arch/isa.py | pfalcon/ppci | ea72967c8984757b4665a2fb0db095f32687eabf | [
"BSD-2-Clause"
] | 74 | 2020-05-26T18:05:48.000Z | 2021-02-13T21:55:39.000Z | ppci/arch/isa.py | pfalcon/ppci | ea72967c8984757b4665a2fb0db095f32687eabf | [
"BSD-2-Clause"
] | 19 | 2020-05-27T19:22:11.000Z | 2022-02-17T18:53:52.000Z | """
Isa related classes.
These can be used to define an instruction set.
"""
from collections import namedtuple
from ..utils.tree import Tree, from_string
from .encoding import Relocation
Pattern = namedtuple(
"Pattern",
["non_term", "tree", "size", "cycles", "energy", "condition", "method"],
)
class Isa:
... | 29.258824 | 76 | 0.634499 |
from collections import namedtuple
from ..utils.tree import Tree, from_string
from .encoding import Relocation
Pattern = namedtuple(
"Pattern",
["non_term", "tree", "size", "cycles", "energy", "condition", "method"],
)
class Isa:
def __init__(self):
self.instructions = []
self.relocati... | true | true |
f74461ef5afc9ea892d3b2c9439e7f121724ecb6 | 3,188 | py | Python | api/src/opentrons/protocol_engine/execution/equipment.py | faliester/opentrons | e945d0f72fed39b0f68c0b30b7afd1981644184f | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/protocol_engine/execution/equipment.py | faliester/opentrons | e945d0f72fed39b0f68c0b30b7afd1981644184f | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/protocol_engine/execution/equipment.py | faliester/opentrons | e945d0f72fed39b0f68c0b30b7afd1981644184f | [
"Apache-2.0"
] | null | null | null | """Equipment command side-effect logic."""
from dataclasses import dataclass
from typing import Tuple
from opentrons_shared_data.labware.dev_types import LabwareDefinition
from opentrons_shared_data.pipette.dev_types import PipetteName
from opentrons.types import MountType
from opentrons.hardware_control.api import AP... | 29.518519 | 80 | 0.67064 | from dataclasses import dataclass
from typing import Tuple
from opentrons_shared_data.labware.dev_types import LabwareDefinition
from opentrons_shared_data.pipette.dev_types import PipetteName
from opentrons.types import MountType
from opentrons.hardware_control.api import API as HardwareAPI
from ..errors import Fail... | true | true |
f74462f2e99627da9aec00e7a02b9fd3719d3f8f | 5,646 | py | Python | field.py | Masynchin/minesweeper | 63e6486f319ebd7c02006906fe712088ea7b33e2 | [
"MIT"
] | null | null | null | field.py | Masynchin/minesweeper | 63e6486f319ebd7c02006906fe712088ea7b33e2 | [
"MIT"
] | null | null | null | field.py | Masynchin/minesweeper | 63e6486f319ebd7c02006906fe712088ea7b33e2 | [
"MIT"
] | null | null | null | import itertools as it
import random
from typing import Iterator, List, Tuple
from cell import Cell
from exceptions import BombDetonation, CellOutOfRange, NotEnoughFlags
def handle_out_of_range(func):
"""Обработка позиции клетки вне поля.
Обработка ситуации, когда клетки с введёнными игроком координатами
... | 32.825581 | 79 | 0.619377 | import itertools as it
import random
from typing import Iterator, List, Tuple
from cell import Cell
from exceptions import BombDetonation, CellOutOfRange, NotEnoughFlags
def handle_out_of_range(func):
def new_func(*args, **kwargs):
try:
return func(*args, **kwargs)
except IndexError:... | true | true |
f744638f37cbe7deda7bbaa7237079efd0ed54f0 | 2,069 | py | Python | remio/sevent.py | Hikki12/remio | 17942bffe3c0619d3435b1a12399b116d4c800e3 | [
"Apache-2.0"
] | null | null | null | remio/sevent.py | Hikki12/remio | 17942bffe3c0619d3435b1a12399b116d4c800e3 | [
"Apache-2.0"
] | null | null | null | remio/sevent.py | Hikki12/remio | 17942bffe3c0619d3435b1a12399b116d4c800e3 | [
"Apache-2.0"
] | null | null | null | class Emitter:
"""This class implements a simple event emitter.
Args:
emitterIsEnabled: enable callbacks execution?
Example usage::
callback = lambda message: print(message)
event = Emitter()
event.on('ready', callback)
event.emit('ready', 'Finished!')
"""
d... | 31.348485 | 76 | 0.564041 | class Emitter:
def __init__(self, emitterIsEnabled: bool = True, *args, **kwargs):
self.callbacks = None
self.emitterIsEnabled = emitterIsEnabled
def on(self, eventName: str = "", callback=None):
if self.callbacks is None:
self.callbacks = {}
if eventName in self.c... | true | true |
f7446411d57e87ff693b20da5ab6083ac3fd75c0 | 278 | py | Python | blog/app.py | VBlizzard/FlaskBlog | a846d7bba1cd7f7afe5d940f7308d1ed39af50f0 | [
"MIT"
] | null | null | null | blog/app.py | VBlizzard/FlaskBlog | a846d7bba1cd7f7afe5d940f7308d1ed39af50f0 | [
"MIT"
] | null | null | null | blog/app.py | VBlizzard/FlaskBlog | a846d7bba1cd7f7afe5d940f7308d1ed39af50f0 | [
"MIT"
] | null | null | null | from flask.ext.mongoengine import MongoEngine
from flask import Flask
app = Flask('blog')
app.config["MONGODB_SETTINGS"] = {'DB': "PythonBlogg"}
app.debug = True
app.secret_key = 'abcd'
db = MongoEngine(app)
from blog import controllers
from blog.models import Post, Admin | 18.533333 | 54 | 0.751799 | from flask.ext.mongoengine import MongoEngine
from flask import Flask
app = Flask('blog')
app.config["MONGODB_SETTINGS"] = {'DB': "PythonBlogg"}
app.debug = True
app.secret_key = 'abcd'
db = MongoEngine(app)
from blog import controllers
from blog.models import Post, Admin | true | true |
f7446789de69a1cc2ccc02ff30a5745fbf0a9eb7 | 3,703 | py | Python | pdfforms/cli.py | laserK3000/pdfforms | f3c7c29f26ce896aeafa8dde2c78e8f395a5c1fb | [
"MIT"
] | 49 | 2017-08-01T19:24:11.000Z | 2022-02-26T18:46:59.000Z | pdfforms/cli.py | laserK3000/pdfforms | f3c7c29f26ce896aeafa8dde2c78e8f395a5c1fb | [
"MIT"
] | 20 | 2017-11-17T08:53:09.000Z | 2022-03-03T09:14:40.000Z | pdfforms/cli.py | laserK3000/pdfforms | f3c7c29f26ce896aeafa8dde2c78e8f395a5c1fb | [
"MIT"
] | 25 | 2018-03-22T16:31:46.000Z | 2022-02-04T16:51:38.000Z | #!/usr/bin/env python3
"cli to inspect and fill pdf fillable forms"
import argparse
import sys
from . import pdfforms
def inspect_pdfs(args):
"entry point for inspect command"
for filepath in pdfforms.inspect_pdfs(
pdf_files=args.pdf_file,
field_defs_file=args.field_defs_file,
prefix=... | 28.05303 | 90 | 0.622738 |
import argparse
import sys
from . import pdfforms
def inspect_pdfs(args):
for filepath in pdfforms.inspect_pdfs(
pdf_files=args.pdf_file,
field_defs_file=args.field_defs_file,
prefix=args.prefix,
):
print(filepath)
def fill_pdfs(args):
value_transforms = []
if args.... | true | true |
f74468290c462f85ad2d4f2f8b70be8439371915 | 2,504 | py | Python | sympy/printing/conventions.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 2 | 2018-12-05T02:30:43.000Z | 2020-11-14T01:43:15.000Z | sympy/printing/conventions.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 1 | 2015-11-01T17:20:32.000Z | 2015-11-01T17:20:32.000Z | sympy/printing/conventions.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 1 | 2018-10-22T09:17:11.000Z | 2018-10-22T09:17:11.000Z | """
A few practical conventions common to all printers.
"""
from __future__ import print_function, division
import re
import collections
_name_with_digits_p = re.compile(r'^([a-zA-Z]+)([0-9]+)$')
def split_super_sub(text):
"""Split a symbol name into a name, superscripts and subscripts
The first part ... | 29.809524 | 75 | 0.60623 |
from __future__ import print_function, division
import re
import collections
_name_with_digits_p = re.compile(r'^([a-zA-Z]+)([0-9]+)$')
def split_super_sub(text):
if len(text) == 0:
return text, [], []
pos = 0
name = None
supers = []
subs = []
while pos < len(text):
start ... | true | true |
f7446857ba5f21d6d45528e2d3d757ec9c5a028e | 3,457 | py | Python | PpiNetworkPrismPredictions.py | ku-cosbi/ppi-network-alternative | 9aa45c97f11252d95027787b178bc336f949db89 | [
"MIT"
] | 3 | 2021-07-07T08:49:10.000Z | 2022-01-02T10:49:48.000Z | PpiNetworkPrismPredictions.py | ku-cosbi/ppi-network-alternative | 9aa45c97f11252d95027787b178bc336f949db89 | [
"MIT"
] | null | null | null | PpiNetworkPrismPredictions.py | ku-cosbi/ppi-network-alternative | 9aa45c97f11252d95027787b178bc336f949db89 | [
"MIT"
] | 3 | 2019-01-24T12:53:28.000Z | 2021-07-07T10:38:26.000Z | import time
t1 = time.time()
geneIdNetworkFile = open('PPI_Network.txt', 'r')
PpiNetworkPredictionsFile = open('PPI_Network_Prism_Predictions.txt', 'w')
prismPredictionsFile = open('PrismPredictions.txt', 'r')
prismPredictions = prismPredictionsFile.readlines();
prismPredictionsFile.close()
alternativeConformationsF... | 46.093333 | 171 | 0.497541 | import time
t1 = time.time()
geneIdNetworkFile = open('PPI_Network.txt', 'r')
PpiNetworkPredictionsFile = open('PPI_Network_Prism_Predictions.txt', 'w')
prismPredictionsFile = open('PrismPredictions.txt', 'r')
prismPredictions = prismPredictionsFile.readlines();
prismPredictionsFile.close()
alternativeConformationsF... | true | true |
f744686c5555f1d7a2a0ee633be346e485524fec | 13,235 | py | Python | stuff/preprocess_bilstm.py | maobubu/stock-prediction | b2442ccb027c25809a33a610f010cdec077bf61a | [
"Apache-2.0"
] | 44 | 2018-10-26T23:41:59.000Z | 2022-02-23T04:29:12.000Z | stuff/preprocess_bilstm.py | maobubu/stock-prediction | b2442ccb027c25809a33a610f010cdec077bf61a | [
"Apache-2.0"
] | 6 | 2018-12-26T23:45:58.000Z | 2021-03-31T19:36:51.000Z | stuff/preprocess_bilstm.py | maobubu/stock-prediction | b2442ccb027c25809a33a610f010cdec077bf61a | [
"Apache-2.0"
] | 14 | 2019-03-11T17:15:20.000Z | 2021-10-04T15:49:11.000Z | import json
import pandas as pd
import re, os, glob
import numpy as np
from collections import defaultdict
import nltk
import string
from gensim.models import Phrases
from gensim.utils import SaveLoad
from gensim.models.phrases import Phraser
from nltk.corpus import stopwords # Import the stop word list
#from sklearn.... | 47.607914 | 114 | 0.66921 | import json
import pandas as pd
import re, os, glob
import numpy as np
from collections import defaultdict
import nltk
import string
from gensim.models import Phrases
from gensim.utils import SaveLoad
from gensim.models.phrases import Phraser
from nltk.corpus import stopwords
from datetime import datetime
from date... | true | true |
f74468cae57435a06f1812336c09bda99a327d18 | 27,448 | py | Python | fastai/torch_core.py | stestagg/fastai | 3afb133cee515c9f373f1d91b2bbd2a8301ec284 | [
"Apache-2.0"
] | null | null | null | fastai/torch_core.py | stestagg/fastai | 3afb133cee515c9f373f1d91b2bbd2a8301ec284 | [
"Apache-2.0"
] | null | null | null | fastai/torch_core.py | stestagg/fastai | 3afb133cee515c9f373f1d91b2bbd2a8301ec284 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/00_torch_core.ipynb (unless otherwise specified).
__all__ = ['progress_bar', 'master_bar', 'subplots', 'show_image', 'show_titled_image', 'show_images', 'ArrayBase',
'ArrayImageBase', 'ArrayImage', 'ArrayImageBW', 'ArrayMask', 'tensor', 'set_seed', 'get_random... | 35.646753 | 152 | 0.664347 |
__all__ = ['progress_bar', 'master_bar', 'subplots', 'show_image', 'show_titled_image', 'show_images', 'ArrayBase',
'ArrayImageBase', 'ArrayImage', 'ArrayImageBW', 'ArrayMask', 'tensor', 'set_seed', 'get_random_states',
'set_random_states', 'no_random', 'unsqueeze', 'unsqueeze_', 'apply', 'maybe... | true | true |
f74468debd020baba24b999940f02dfe4db271cf | 1,430 | py | Python | src/meltano/core/utils/pidfile.py | code-watch/meltano | 2afff73ed43669b5134dacfce61814f7f4e77a13 | [
"MIT"
] | 8 | 2020-06-16T22:29:54.000Z | 2021-06-04T11:57:57.000Z | src/meltano/core/utils/pidfile.py | dotmesh-io/meltano | 4616d44ded9dff4e9ad19a9004349e9baa16ddd5 | [
"MIT"
] | 38 | 2019-12-09T06:53:33.000Z | 2022-03-29T22:29:19.000Z | src/meltano/core/utils/pidfile.py | aroder/meltano | b8d1d812f4051b6334986fc6b447d23c4d0d5043 | [
"MIT"
] | 2 | 2020-06-16T22:29:59.000Z | 2020-11-04T05:47:50.000Z | import psutil
import logging
from pathlib import Path
from typing import Union
logger = logging.getLogger(__name__)
class PIDFile:
def __init__(self, path: Union[str, Path]):
self.path = Path(path)
self._pid = None
@property
def pid(self):
return self._pid or self.load_pid()
... | 23.833333 | 73 | 0.599301 | import psutil
import logging
from pathlib import Path
from typing import Union
logger = logging.getLogger(__name__)
class PIDFile:
def __init__(self, path: Union[str, Path]):
self.path = Path(path)
self._pid = None
@property
def pid(self):
return self._pid or self.load_pid()
... | true | true |
f7446a21e90ea1c6932dd3349446ef02d59391fa | 257 | py | Python | paypro/paypro/doctype/designation/designation.py | barathprathosh/PayPRO | 4963bf9983a13a3953dad033eb1193000e9af251 | [
"MIT"
] | null | null | null | paypro/paypro/doctype/designation/designation.py | barathprathosh/PayPRO | 4963bf9983a13a3953dad033eb1193000e9af251 | [
"MIT"
] | null | null | null | paypro/paypro/doctype/designation/designation.py | barathprathosh/PayPRO | 4963bf9983a13a3953dad033eb1193000e9af251 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Teampro and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class Designation(Document):
pass
| 23.363636 | 49 | 0.774319 |
from __future__ import unicode_literals
from frappe.model.document import Document
class Designation(Document):
pass
| true | true |
f7446ab7e38ca354c89e6ca03d9847a06491b576 | 3,098 | py | Python | chainer/links/cnet/link_cnet_linear.py | asrlabncku/RAP | 11fab37c8d98257ec0aed1b306aa9709a3a51328 | [
"MIT"
] | null | null | null | chainer/links/cnet/link_cnet_linear.py | asrlabncku/RAP | 11fab37c8d98257ec0aed1b306aa9709a3a51328 | [
"MIT"
] | null | null | null | chainer/links/cnet/link_cnet_linear.py | asrlabncku/RAP | 11fab37c8d98257ec0aed1b306aa9709a3a51328 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import numpy
from chainer import link
from chainer.functions.cnet import function_cnet_linear
import math
from chainer import initializers
from chainer import cuda
class CnetLinear(link.Link):
"""Binary Linear layer (a.k.a. binary fully-connected layer).
This is a lin... | 34.043956 | 86 | 0.643641 | from __future__ import absolute_import
import numpy
from chainer import link
from chainer.functions.cnet import function_cnet_linear
import math
from chainer import initializers
from chainer import cuda
class CnetLinear(link.Link):
def __init__(self, in_size, out_size, wscale=1, bias=0, nobias=False,
... | true | true |
f7446bc68db7f3106568f3dbaf43676d7faa367d | 14,553 | py | Python | tensorflow/run.py | nkzhlee/RCModel | 3288250edc8f4021f40e49f547b393434f02be4b | [
"Apache-2.0"
] | 1 | 2018-03-23T05:40:40.000Z | 2018-03-23T05:40:40.000Z | tensorflow/run.py | nkzhlee/RCModel | 3288250edc8f4021f40e49f547b393434f02be4b | [
"Apache-2.0"
] | null | null | null | tensorflow/run.py | nkzhlee/RCModel | 3288250edc8f4021f40e49f547b393434f02be4b | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf8 -*-
# ==============================================================================
# Copyright 2017 Baidu.com, Inc. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of th... | 50.707317 | 281 | 0.647427 |
import sys
reload(sys)
sys.setdefaultencoding('utf8')
sys.path.append('..')
sys.setrecursionlimit(100000)
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
import pickle
import argparse
import logging
from dataset import BRCDataset
from vocab import Vocab
from rc_model import RCModel
from mcst_model i... | true | true |
f7446ca482e523b3f6fb3b1ef9cc955f4fa7e1dd | 3,601 | py | Python | app/recipe/views.py | ruiqim/recipe-app-api | 1a5d0d163e84174684c54161e218b9857c931d4c | [
"MIT"
] | null | null | null | app/recipe/views.py | ruiqim/recipe-app-api | 1a5d0d163e84174684c54161e218b9857c931d4c | [
"MIT"
] | null | null | null | app/recipe/views.py | ruiqim/recipe-app-api | 1a5d0d163e84174684c54161e218b9857c931d4c | [
"MIT"
] | null | null | null | from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework import viewsets, mixins, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from core.models import Tag, Ingredient, Recipe
from recipe... | 34.961165 | 78 | 0.673146 | from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework import viewsets, mixins, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.permissions import IsAuthenticated
from core.models import Tag, Ingredient, Recipe
from recipe... | true | true |
f7446cf87876110d957d7efc95131a2e302da0ff | 37,702 | py | Python | plugins/modules/oci_network_load_balancer.py | sagar2938/oci-ansible-collection | 5b8ce583a0d5d0aabf14494d61aea4649e18d1e6 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_network_load_balancer.py | sagar2938/oci-ansible-collection | 5b8ce583a0d5d0aabf14494d61aea4649e18d1e6 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_network_load_balancer.py | sagar2938/oci-ansible-collection | 5b8ce583a0d5d0aabf14494d61aea4649e18d1e6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 47.245614 | 160 | 0.558485 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_network_load_balancer
short_description: Manage a NetworkLoadBalancer re... | true | true |
f7446da2468be6bc2f7ee1d78a785a7823301f7e | 18,453 | py | Python | pcdswidgets/_version.py | n-wbrown/pcdswidgets | e8ea7b5213d0281c6ac1b9dde4c34e79cb0b1821 | [
"BSD-3-Clause-LBNL"
] | 1 | 2019-07-09T20:17:03.000Z | 2019-07-09T20:17:03.000Z | pcdswidgets/_version.py | n-wbrown/pcdswidgets | e8ea7b5213d0281c6ac1b9dde4c34e79cb0b1821 | [
"BSD-3-Clause-LBNL"
] | 66 | 2018-12-06T21:34:08.000Z | 2022-03-29T23:05:34.000Z | pcdswidgets/_version.py | n-wbrown/pcdswidgets | e8ea7b5213d0281c6ac1b9dde4c34e79cb0b1821 | [
"BSD-3-Clause-LBNL"
] | 8 | 2019-02-21T21:28:29.000Z | 2022-03-25T21:57:25.000Z |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | 35.418426 | 79 | 0.58462 |
import errno
import os
import re
import subprocess
import sys
def get_keywords():
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
git_date = "$Format:%ci$"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
class Version... | true | true |
f7446fe9e0d2bec83528a69d52c7ed71927d27b9 | 5,907 | py | Python | lib/builder/postprocessor.py | zye1996/3DSSD | 036983e282cd13e6a5bf0b51ff6ad31639a75b07 | [
"MIT"
] | null | null | null | lib/builder/postprocessor.py | zye1996/3DSSD | 036983e282cd13e6a5bf0b51ff6ad31639a75b07 | [
"MIT"
] | null | null | null | lib/builder/postprocessor.py | zye1996/3DSSD | 036983e282cd13e6a5bf0b51ff6ad31639a75b07 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from lib.core.config import cfg
from lib.utils.anchors_util import project_to_bev
from lib.utils.box_3d_utils import box_3d_to_anchor
import lib.dataset.maps_dict as maps_dict
class PostProcessor:
def __init__(self, stage, cls_num):
if stage == 0:
se... | 47.637097 | 165 | 0.681395 | import numpy as np
import tensorflow as tf
from lib.core.config import cfg
from lib.utils.anchors_util import project_to_bev
from lib.utils.box_3d_utils import box_3d_to_anchor
import lib.dataset.maps_dict as maps_dict
class PostProcessor:
def __init__(self, stage, cls_num):
if stage == 0:
se... | true | true |
f74470686da6ef4feb0a860a63d1fe9e4388994b | 2,109 | py | Python | AppServer/lib/django-1.4/tests/modeltests/field_subclassing/fields.py | loftwah/appscale | 586fc1347ebc743d7a632de698f4dbfb09ae38d6 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/lib/django-1.4/tests/modeltests/field_subclassing/fields.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/lib/django-1.4/tests/modeltests/field_subclassing/fields.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | from django.db import models
from django.utils import simplejson as json
from django.utils.encoding import force_unicode
class Small(object):
"""
A simple class to show that non-trivial Python objects can be used as
attributes.
"""
def __init__(self, first, second):
self.first, self.second... | 28.5 | 81 | 0.646752 | from django.db import models
from django.utils import simplejson as json
from django.utils.encoding import force_unicode
class Small(object):
def __init__(self, first, second):
self.first, self.second = first, second
def __unicode__(self):
return u'%s%s' % (force_unicode(self.first), force_un... | true | true |
f7447123f48b3128be665a57e95a92983477a56e | 677 | py | Python | main.py | satbirsoni/DiscFiller | 40d90ba33004eb97e82a617fa5fd0dc6f680221c | [
"Apache-2.0"
] | null | null | null | main.py | satbirsoni/DiscFiller | 40d90ba33004eb97e82a617fa5fd0dc6f680221c | [
"Apache-2.0"
] | null | null | null | main.py | satbirsoni/DiscFiller | 40d90ba33004eb97e82a617fa5fd0dc6f680221c | [
"Apache-2.0"
] | null | null | null | import argparse
if __name__ == '__main__':
argument_Parser = argparse.ArgumentParser(description='Disc Filler')
argument_Parser.add_argument('num_files', help='num_files')
argument_Parser.add_argument('size_of_file', help='size_of_file')
args = argument_Parser.parse_args()
num_files = 0
... | 30.772727 | 73 | 0.598227 | import argparse
if __name__ == '__main__':
argument_Parser = argparse.ArgumentParser(description='Disc Filler')
argument_Parser.add_argument('num_files', help='num_files')
argument_Parser.add_argument('size_of_file', help='size_of_file')
args = argument_Parser.parse_args()
num_files = 0
... | true | true |
f74472da3c757f609dda247408d7ecc02eba4648 | 5,640 | py | Python | episcanpy/logging.py | le-ander/epiScanpy | f36c4c4e5ba65693464e3dfa954f8c2778ad603c | [
"BSD-3-Clause"
] | null | null | null | episcanpy/logging.py | le-ander/epiScanpy | f36c4c4e5ba65693464e3dfa954f8c2778ad603c | [
"BSD-3-Clause"
] | null | null | null | episcanpy/logging.py | le-ander/epiScanpy | f36c4c4e5ba65693464e3dfa954f8c2778ad603c | [
"BSD-3-Clause"
] | null | null | null | """Logging and Profiling
"""
import time as time_module
import datetime
#from anndata import logging
from . import settings
_VERBOSITY_LEVELS_FROM_STRINGS = {
'error': 0,
'warn': 1,
'info': 2,
'hint': 3,
}
def info(*args, **kwargs):
return msg(*args, v='info', **kwargs)
def error(*args, **kwa... | 27.378641 | 84 | 0.617376 |
import time as time_module
import datetime
from . import settings
_VERBOSITY_LEVELS_FROM_STRINGS = {
'error': 0,
'warn': 1,
'info': 2,
'hint': 3,
}
def info(*args, **kwargs):
return msg(*args, v='info', **kwargs)
def error(*args, **kwargs):
args = ('Error:',) + args
return msg(*args,... | true | true |
f7447465c3ac295ca5d908e5a196ebe366c9ff6f | 27,172 | py | Python | tests/python/relay/test_op_level5.py | wix-playground/incubator-tvm | c9e2cc2c3daa8065257c76fce42d9c22e06ebb54 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/python/relay/test_op_level5.py | SunicYosen/tvm-rram | 99734d29b77ef88fe81b0fd0cb2b71db8dc2608e | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/python/relay/test_op_level5.py | SunicYosen/tvm-rram | 99734d29b77ef88fe81b0fd0cb2b71db8dc2608e | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 46.132428 | 182 | 0.58943 |
import math
import numpy as np
import tvm
from tvm import relay
from tvm.relay import transform
from tvm.relay.testing import ctx_list
import topi.testing
def run_infer_type(expr):
mod = relay.Module.from_expr(expr)
mod = transform.InferType()(mod)
entry = mod["main"]
return entry if is... | true | true |
f74474c4da388ac918e422abe2850764a0249988 | 954 | py | Python | other/9_morphological.py | gauthamkrishna-g/Gest-Face | f20def897d8ce2b10c6312b02cb57cb7241a9d93 | [
"MIT"
] | 2 | 2017-12-08T05:51:37.000Z | 2017-12-08T07:27:28.000Z | other/9_morphological.py | gauthamkrishna-g/Gest-Face | f20def897d8ce2b10c6312b02cb57cb7241a9d93 | [
"MIT"
] | null | null | null | other/9_morphological.py | gauthamkrishna-g/Gest-Face | f20def897d8ce2b10c6312b02cb57cb7241a9d93 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
cap = cv2.VideoCapture(0)
while True:
ret, frame = cap.read()
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
lower_red = np.array([30, 150, 50])
upper_red = np.array([255, 255, 180])
mask = cv2.inRange(hsv, lower_red, upper_red)
res = cv2.bitw... | 27.257143 | 62 | 0.618449 | import cv2
import numpy as np
cap = cv2.VideoCapture(0)
while True:
ret, frame = cap.read()
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
lower_red = np.array([30, 150, 50])
upper_red = np.array([255, 255, 180])
mask = cv2.inRange(hsv, lower_red, upper_red)
res = cv2.bitw... | true | true |
f74474d9aebd978b02b69236a695732210ab2a3d | 184 | py | Python | tips/admin.py | Ichinga-Samuel/Python-Tips | 5e80621ab0d945b873aa499239b27ac2f39335c2 | [
"MIT"
] | null | null | null | tips/admin.py | Ichinga-Samuel/Python-Tips | 5e80621ab0d945b873aa499239b27ac2f39335c2 | [
"MIT"
] | null | null | null | tips/admin.py | Ichinga-Samuel/Python-Tips | 5e80621ab0d945b873aa499239b27ac2f39335c2 | [
"MIT"
] | null | null | null | from django.contrib import admin
from tips.models import Tips, Tags, Links
# Register your models here.
admin.site.register(Tips)
admin.site.register(Tags)
admin.site.register(Links)
| 23 | 41 | 0.798913 | from django.contrib import admin
from tips.models import Tips, Tags, Links
admin.site.register(Tips)
admin.site.register(Tags)
admin.site.register(Links)
| true | true |
f74475164e16b28f018de31d6a54a2ecdd257a4b | 642 | py | Python | indicator.py | Nobuo-Namura/EPBII | ad50b7c4e291ea53a9b3924f24cb84aed4d347b2 | [
"MIT"
] | 1 | 2020-05-06T12:34:49.000Z | 2020-05-06T12:34:49.000Z | indicator.py | Nobuo-Namura/EPBII | ad50b7c4e291ea53a9b3924f24cb84aed4d347b2 | [
"MIT"
] | null | null | null | indicator.py | Nobuo-Namura/EPBII | ad50b7c4e291ea53a9b3924f24cb84aed4d347b2 | [
"MIT"
] | 1 | 2020-12-01T09:02:46.000Z | 2020-12-01T09:02:46.000Z | # -*- coding: utf-8 -*-
"""
indicator.py
Copyright (c) 2020 Nobuo Namura
This code is released under the MIT License.
"""
import numpy as np
from scipy.spatial import distance
#======================================================================
def rmse_history(x_rmse, problem, func, nfg=0):
rmse = 0.0
for... | 26.75 | 71 | 0.5 |
import numpy as np
from scipy.spatial import distance
def rmse_history(x_rmse, problem, func, nfg=0):
rmse = 0.0
for x in x_rmse:
rmse += (problem(x)[nfg] - func(x))**2.0
rmse = np.sqrt(rmse/float(len(x_rmse[:,0])))
return rmse
def igd_history(f, igd_ref):
dist = distance.cdist(f, igd_... | true | true |
f7447584666657baa0d569d54b72a0b292956711 | 1,753 | py | Python | src/human_body_prior/tools/configurations.py | zokin/human_body_prior | 3791e04f8ba25997dda43aea0c3e4d988c550300 | [
"Xnet",
"X11"
] | 412 | 2019-06-13T21:15:49.000Z | 2022-03-30T07:18:39.000Z | src/human_body_prior/tools/configurations.py | 1165048017/human_body_prior | 0278cb45180992e4d39ba1a11601f5ecc53ee148 | [
"Xnet",
"X11"
] | 53 | 2019-06-18T04:05:05.000Z | 2022-03-31T15:02:47.000Z | src/human_body_prior/tools/configurations.py | 1165048017/human_body_prior | 0278cb45180992e4d39ba1a11601f5ecc53ee148 | [
"Xnet",
"X11"
] | 103 | 2019-06-12T19:10:32.000Z | 2022-03-17T20:49:50.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG),
# acting on behalf of its Max Planck Institute for Intelligent Systems and the
# Max Planck Institute for Biological Cybernetics. All rights reserved.
#
# Max-Planck-Gesellschaft zur Förderung der Wissens... | 36.520833 | 115 | 0.731318 |
from dotmap import DotMap
import os
import yaml
def load_config(default_ps_fname=None, **kwargs):
if isinstance(default_ps_fname, str):
assert os.path.exists(default_ps_fname), FileNotFoundError(default_ps_fname)
assert default_ps_fname.lower().endswith('.yaml'), NotImplemente... | true | true |
f74475a05a558baa31f99ec66506a1e98e8f6d91 | 1,455 | py | Python | sqlalchemy_utils/types/url.py | kelvinhammond/sqlalchemy-utils | 64714c9a0ca44594e00ea70c31aa25269172f6f6 | [
"BSD-3-Clause"
] | null | null | null | sqlalchemy_utils/types/url.py | kelvinhammond/sqlalchemy-utils | 64714c9a0ca44594e00ea70c31aa25269172f6f6 | [
"BSD-3-Clause"
] | null | null | null | sqlalchemy_utils/types/url.py | kelvinhammond/sqlalchemy-utils | 64714c9a0ca44594e00ea70c31aa25269172f6f6 | [
"BSD-3-Clause"
] | null | null | null | furl = None
try:
from furl import furl
except ImportError:
pass
import six
from sqlalchemy import types
from .scalar_coercible import ScalarCoercible
class URLType(types.TypeDecorator, ScalarCoercible):
"""
URLType stores furl_ objects into database.
.. _furl: https://github.com/gruns/furl
... | 22.734375 | 75 | 0.621306 | furl = None
try:
from furl import furl
except ImportError:
pass
import six
from sqlalchemy import types
from .scalar_coercible import ScalarCoercible
class URLType(types.TypeDecorator, ScalarCoercible):
impl = types.UnicodeText
def process_bind_param(self, value, dialect):
if furl is not No... | true | true |
f744792341a7c726e72adae2392fa7c9fc7bfc7e | 1,272 | py | Python | competition2/src/test.py | HolaClubSandwich/412Competition2 | 2942166733cb742ea8017abb6d7611ef85063893 | [
"Apache-2.0"
] | null | null | null | competition2/src/test.py | HolaClubSandwich/412Competition2 | 2942166733cb742ea8017abb6d7611ef85063893 | [
"Apache-2.0"
] | null | null | null | competition2/src/test.py | HolaClubSandwich/412Competition2 | 2942166733cb742ea8017abb6d7611ef85063893 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
import cv2
from pytesseract import image_to_string
import numpy as np
from ocr_server import OCRDetect
print("hello world")
ocrDetect = OCRDetect()
# img = cv2.imread('/home/user/catkin_ws/src/competition2/models/map/one1.png', 1) #, cv2.IMREAD_GRAYSCALE)
detect_text = ocrDetect.read_sign('/... | 27.652174 | 107 | 0.687893 |
import cv2
from pytesseract import image_to_string
import numpy as np
from ocr_server import OCRDetect
print("hello world")
ocrDetect = OCRDetect()
t.read_sign('/home/user/catkin_ws/src/competition2/models/lobby/one.png')
print(detect_text)
if 'highest' in detect_text:
print('TRUE')
| true | true |
f7447b8ebb525d77858a92de03dda197e5d55056 | 348 | py | Python | SC/feasibility.py | wchen459/hgan_jmd_2019 | ca8e58b4525eb59f51ec699f1e874eca455a6bac | [
"MIT"
] | 3 | 2019-09-29T05:21:28.000Z | 2021-01-18T04:25:25.000Z | SC/feasibility.py | wchen459/hgan_jmd_2019 | ca8e58b4525eb59f51ec699f1e874eca455a6bac | [
"MIT"
] | null | null | null | SC/feasibility.py | wchen459/hgan_jmd_2019 | ca8e58b4525eb59f51ec699f1e874eca455a6bac | [
"MIT"
] | 1 | 2019-06-13T18:40:03.000Z | 2019-06-13T18:40:03.000Z | import numpy as np
from SC.build_data import check_feasibility
if __name__ == '__main__':
X = np.load('../results/SC/SC.npy')
X0 = X[:,:64]
X1 = X[:,64:]
for i in range(X.shape[0]):
is_feasibe = check_feasibility(X0[i], X1[i])
print('{}: {}'.format(i, is_feasibe))
if not i... | 24.857143 | 52 | 0.563218 | import numpy as np
from SC.build_data import check_feasibility
if __name__ == '__main__':
X = np.load('../results/SC/SC.npy')
X0 = X[:,:64]
X1 = X[:,64:]
for i in range(X.shape[0]):
is_feasibe = check_feasibility(X0[i], X1[i])
print('{}: {}'.format(i, is_feasibe))
if not i... | true | true |
f7447c1aef8b93e078890147d1206668eebcc6a9 | 1,384 | py | Python | routes/v1/DeepZoom.py | scimk/path_deepzoom | 2d3012082527df81998d7913ea04cb01664f3650 | [
"MIT"
] | null | null | null | routes/v1/DeepZoom.py | scimk/path_deepzoom | 2d3012082527df81998d7913ea04cb01664f3650 | [
"MIT"
] | null | null | null | routes/v1/DeepZoom.py | scimk/path_deepzoom | 2d3012082527df81998d7913ea04cb01664f3650 | [
"MIT"
] | null | null | null | import os
from bson.json_util import dumps
from flask_restful import Resource
from flask import Response
from utils.cache import cache
from utils.deepzoom import get_slide
class DeepZoom(Resource):
def __init__(self, config):
"""initialize DeepZoom resource
Args:
db: mongo db connection
config: application... | 24.714286 | 105 | 0.639451 | import os
from bson.json_util import dumps
from flask_restful import Resource
from flask import Response
from utils.cache import cache
from utils.deepzoom import get_slide
class DeepZoom(Resource):
def __init__(self, config):
self.config = config
@cache.cached()
def get(self, path):
path = "/" + path
if n... | true | true |
f7447f7037de05db8838b5b735586c1d4bbbe2c7 | 1,185 | py | Python | hc/api/migrations/0059_auto_20190314_1744.py | sumonst21/healthchecks | 967ca840adee6c72addde46c944c88b1bd5484e2 | [
"BSD-3-Clause"
] | 4,813 | 2015-07-27T11:44:52.000Z | 2022-03-31T14:24:07.000Z | hc/api/migrations/0059_auto_20190314_1744.py | sumonst21/healthchecks | 967ca840adee6c72addde46c944c88b1bd5484e2 | [
"BSD-3-Clause"
] | 579 | 2015-07-20T11:49:19.000Z | 2022-03-31T18:20:11.000Z | hc/api/migrations/0059_auto_20190314_1744.py | sumonst21/healthchecks | 967ca840adee6c72addde46c944c88b1bd5484e2 | [
"BSD-3-Clause"
] | 644 | 2015-09-11T16:14:26.000Z | 2022-03-31T13:20:20.000Z | # Generated by Django 2.1.7 on 2019-03-14 17:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("api", "0058_auto_20190312_1716")]
operations = [
migrations.AlterField(
model_name="channel",
name="kind",
field=mode... | 31.184211 | 55 | 0.393249 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("api", "0058_auto_20190312_1716")]
operations = [
migrations.AlterField(
model_name="channel",
name="kind",
field=models.CharField(
choices=[
... | true | true |
f7447fc47144bfb53037b1f793b9420043afb61d | 2,569 | py | Python | custom_components/gkeep/sensor.py | kubeeapp/gkeep | 6c4e052c1079f1776baf78c0a5b4b1b73f1830b0 | [
"Apache-2.0"
] | null | null | null | custom_components/gkeep/sensor.py | kubeeapp/gkeep | 6c4e052c1079f1776baf78c0a5b4b1b73f1830b0 | [
"Apache-2.0"
] | null | null | null | custom_components/gkeep/sensor.py | kubeeapp/gkeep | 6c4e052c1079f1776baf78c0a5b4b1b73f1830b0 | [
"Apache-2.0"
] | null | null | null | """Sensor platform for blueprint."""
from homeassistant.helpers.entity import Entity
from homeassistant import config_entries
from .const import ATTRIBUTION, DEFAULT_NAME, DOMAIN_DATA, ICON, DOMAIN, CONF_DEFAULT_LIST
import logging
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(
hass, config... | 28.544444 | 90 | 0.606072 | from homeassistant.helpers.entity import Entity
from homeassistant import config_entries
from .const import ATTRIBUTION, DEFAULT_NAME, DOMAIN_DATA, ICON, DOMAIN, CONF_DEFAULT_LIST
import logging
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(
hass, config, async_add_entities, discovery_info=... | true | true |
f744805c539f147571eedac6e70d87b8e1b88890 | 12,852 | py | Python | hyperpose/Model/openpose/model/mbv2_th_openpose.py | lengyuner/hyperpose4fly | c9866bce1a0109e1b9c727ca550b5a380eb3ee17 | [
"Apache-2.0"
] | null | null | null | hyperpose/Model/openpose/model/mbv2_th_openpose.py | lengyuner/hyperpose4fly | c9866bce1a0109e1b9c727ca550b5a380eb3ee17 | [
"Apache-2.0"
] | null | null | null | hyperpose/Model/openpose/model/mbv2_th_openpose.py | lengyuner/hyperpose4fly | c9866bce1a0109e1b9c727ca550b5a380eb3ee17 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import tensorlayer as tl
from tensorlayer import layers
from tensorlayer.models import Model
from tensorlayer.layers import BatchNorm2d, Conv2d, DepthwiseConv2d, LayerList, MaxPool2d
from ..utils import tf_repeat
from ..define import CocoPart,CocoLimb
initial_w=tl.initializers.random_normal(std... | 63.623762 | 205 | 0.704093 | import tensorflow as tf
import tensorlayer as tl
from tensorlayer import layers
from tensorlayer.models import Model
from tensorlayer.layers import BatchNorm2d, Conv2d, DepthwiseConv2d, LayerList, MaxPool2d
from ..utils import tf_repeat
from ..define import CocoPart,CocoLimb
initial_w=tl.initializers.random_normal(std... | true | true |
f74480c10aa40bd28fca48ff1b95d23610816c6a | 49,542 | py | Python | gbkfit_web/forms/job/params.py | ADACS-Australia/ADACS-GBKFIT | 20c7cafcabb6e75d8c287df06efb43113fdabd25 | [
"MIT"
] | null | null | null | gbkfit_web/forms/job/params.py | ADACS-Australia/ADACS-GBKFIT | 20c7cafcabb6e75d8c287df06efb43113fdabd25 | [
"MIT"
] | null | null | null | gbkfit_web/forms/job/params.py | ADACS-Australia/ADACS-GBKFIT | 20c7cafcabb6e75d8c287df06efb43113fdabd25 | [
"MIT"
] | null | null | null | #==============================================================================
#
# This code was developed as part of the Astronomy Data and Computing Services
# (ADACS; https:#adacs.org.au) 2017B Software Support program.
#
# Written by: Dany Vohl, Lewis Lakerink, Shibli Saleheen
# Date: December 2017
#
# It is... | 29.506849 | 122 | 0.469561 |
o.utils.translation import ugettext_lazy as _
from gbkfit_web.models import ParameterSet, Job, GalaxyModel, Fitter
XO_FIELDS = ['xo_fixed', 'xo_value', 'xo_min', 'xo_max', 'xo_wrap', 'xo_step', 'xo_relstep', 'xo_side',]
YO_FIELDS = ['yo_fixed', 'yo_value', 'yo_min', 'yo_max', 'yo_wrap', 'yo_step', 'yo_relstep', 'y... | true | true |
f744817e85fdb412c5892b7d65c53e54ebb20095 | 322 | py | Python | django-edx-courseware/urls.py | mjrulesamrat/django-edx-courseware | ec47a67e94b71ff95bb009fa95c47c76c21553da | [
"MIT"
] | null | null | null | django-edx-courseware/urls.py | mjrulesamrat/django-edx-courseware | ec47a67e94b71ff95bb009fa95c47c76c21553da | [
"MIT"
] | null | null | null | django-edx-courseware/urls.py | mjrulesamrat/django-edx-courseware | ec47a67e94b71ff95bb009fa95c47c76c21553da | [
"MIT"
] | null | null | null | __author__ = 'Jay Modi'
from django.conf import settings
from django.conf.urls import patterns, include, url
from .views import course_data
urlpatterns = [
url(
r'^courses-data/{}$'.format(
settings.COURSE_ID_PATTERN,
),
course_data,
name='edx_course_progress',
),
... | 18.941176 | 51 | 0.63354 | __author__ = 'Jay Modi'
from django.conf import settings
from django.conf.urls import patterns, include, url
from .views import course_data
urlpatterns = [
url(
r'^courses-data/{}$'.format(
settings.COURSE_ID_PATTERN,
),
course_data,
name='edx_course_progress',
),
... | true | true |
f74482176c6dd77544eba9fae67ff822a6389a5c | 1,457 | py | Python | script/svhn/vgg8/train_rad_script.py | JeremieMelo/L2ight | 67f93b66ddf8bb5a365834b84ed6acdbc4f48eaf | [
"MIT"
] | 7 | 2021-11-02T16:21:47.000Z | 2022-03-09T06:01:25.000Z | script/svhn/vgg8/train_rad_script.py | JeremieMelo/L2ight | 67f93b66ddf8bb5a365834b84ed6acdbc4f48eaf | [
"MIT"
] | null | null | null | script/svhn/vgg8/train_rad_script.py | JeremieMelo/L2ight | 67f93b66ddf8bb5a365834b84ed6acdbc4f48eaf | [
"MIT"
] | null | null | null |
import os
import subprocess
from multiprocessing import Pool
import mlflow
from pyutils.general import ensure_dir, logger
from pyutils.config import configs
root = "log/svhn/vgg8/ss"
script = 'train_learn.py'
config_file = 'config/svhn/vgg8/ss/learn.yml'
configs.load(config_file, recursive=True)
def task_launcher(... | 31 | 91 | 0.625257 |
import os
import subprocess
from multiprocessing import Pool
import mlflow
from pyutils.general import ensure_dir, logger
from pyutils.config import configs
root = "log/svhn/vgg8/ss"
script = 'train_learn.py'
config_file = 'config/svhn/vgg8/ss/learn.yml'
configs.load(config_file, recursive=True)
def task_launcher(... | true | true |
f744838689d8496184545ae60335b18ee84de0e5 | 1,946 | py | Python | M220P - MongoDB for Python Developers/Files/tests/test_create_update_comments.py | ReynerGonzalez/mongodb-university-course | 75175a90a0c94340dd3c0b55f562569cfc80c096 | [
"MIT"
] | null | null | null | M220P - MongoDB for Python Developers/Files/tests/test_create_update_comments.py | ReynerGonzalez/mongodb-university-course | 75175a90a0c94340dd3c0b55f562569cfc80c096 | [
"MIT"
] | null | null | null | M220P - MongoDB for Python Developers/Files/tests/test_create_update_comments.py | ReynerGonzalez/mongodb-university-course | 75175a90a0c94340dd3c0b55f562569cfc80c096 | [
"MIT"
] | 1 | 2021-06-14T04:31:40.000Z | 2021-06-14T04:31:40.000Z | """
Test file for database methods written in db.py
All test methods must receive client as an argument,
otherwise the database variable won't be configured correctly
"""
from mflix.db import add_comment, update_comment, delete_comment, get_movie
from mflix.api.user import User
from pymongo.results import InsertOneRes... | 29.044776 | 75 | 0.725077 | from mflix.db import add_comment, update_comment, delete_comment, get_movie
from mflix.api.user import User
from pymongo.results import InsertOneResult
from datetime import datetime
import pytest
test_user = {
"name": "foobar",
"email": "foobar@baz.com",
}
fake_user = {
"name": "barfoo",
"email": "baz... | true | true |
f74483ad48dcc78d7b7f94b79ae9c7ab6f9b42d9 | 6,022 | py | Python | sdks/python/apache_beam/coders/typecoders_test.py | harrydrippin/beam | 4b413bbb5f8807b0f7a284fd818f2772f036fe55 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2022-01-11T19:43:12.000Z | 2022-01-15T15:45:20.000Z | sdks/python/apache_beam/coders/typecoders_test.py | harrydrippin/beam | 4b413bbb5f8807b0f7a284fd818f2772f036fe55 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 7 | 2022-01-04T21:44:54.000Z | 2022-03-19T12:42:37.000Z | sdks/python/apache_beam/coders/typecoders_test.py | harrydrippin/beam | 4b413bbb5f8807b0f7a284fd818f2772f036fe55 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 8 | 2022-01-04T14:27:54.000Z | 2022-02-16T13:06:43.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 39.359477 | 80 | 0.748589 |
import unittest
from apache_beam.coders import coders
from apache_beam.coders import typecoders
from apache_beam.internal import pickler
from apache_beam.tools import utils
from apache_beam.typehints import typehints
class CustomClass(object):
def __init__(self, n):
self.number = n
def __... | true | true |
f74484bd2016021f8a6b68a26bc5dc287e8c2b9a | 16,224 | py | Python | selfdrive/car/volkswagen/carstate.py | Basketkase/openpilot | 769e1cf7a8322ca83d1a86a2f547acf5e3a5a52e | [
"MIT"
] | 45 | 2020-09-10T02:43:34.000Z | 2022-03-23T12:12:48.000Z | selfdrive/car/volkswagen/carstate.py | Basketkase/openpilot | 769e1cf7a8322ca83d1a86a2f547acf5e3a5a52e | [
"MIT"
] | 10 | 2020-07-17T14:50:38.000Z | 2022-03-08T15:40:52.000Z | selfdrive/car/volkswagen/carstate.py | Basketkase/openpilot | 769e1cf7a8322ca83d1a86a2f547acf5e3a5a52e | [
"MIT"
] | 130 | 2020-08-19T04:20:02.000Z | 2022-03-24T23:05:22.000Z | import numpy as np
from cereal import car
from selfdrive.config import Conversions as CV
from selfdrive.car.interfaces import CarStateBase
from opendbc.can.parser import CANParser
from opendbc.can.can_define import CANDefine
from selfdrive.car.volkswagen.values import DBC_FILES, CANBUS, NetworkLocation, TransmissionTyp... | 57.328622 | 145 | 0.665311 | import numpy as np
from cereal import car
from selfdrive.config import Conversions as CV
from selfdrive.car.interfaces import CarStateBase
from opendbc.can.parser import CANParser
from opendbc.can.can_define import CANDefine
from selfdrive.car.volkswagen.values import DBC_FILES, CANBUS, NetworkLocation, TransmissionTyp... | true | true |
f74487dd1e2fd0da2cf024c7c3052e5819b20d17 | 1,860 | py | Python | usda_data/joinUSDA.py | christophershultz/spatial_ag | 1c56e2e5fbc15a4f56d6d7bb94fab6a796d07dbf | [
"MIT"
] | null | null | null | usda_data/joinUSDA.py | christophershultz/spatial_ag | 1c56e2e5fbc15a4f56d6d7bb94fab6a796d07dbf | [
"MIT"
] | null | null | null | usda_data/joinUSDA.py | christophershultz/spatial_ag | 1c56e2e5fbc15a4f56d6d7bb94fab6a796d07dbf | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import os, pdb, sys
def netIncome():
df = pd.read_csv('usda_data/net_income.csv')
df = df[df['Year'] == 2017].reset_index().drop(['index'], axis = 1)
df = df[['Year', 'State', 'State ANSI', 'County', 'County ANSI', 'Zip Code', 'Value']]
df.columns = ['yr', 'st', ... | 44.285714 | 110 | 0.553763 | import pandas as pd
import numpy as np
import os, pdb, sys
def netIncome():
df = pd.read_csv('usda_data/net_income.csv')
df = df[df['Year'] == 2017].reset_index().drop(['index'], axis = 1)
df = df[['Year', 'State', 'State ANSI', 'County', 'County ANSI', 'Zip Code', 'Value']]
df.columns = ['yr', 'st', ... | true | true |
f74487ef5bb2322465c3034211f8689e5e7546a1 | 1,391 | py | Python | potpourri/simi3.py | kmedian/potpourri | 54f7c517b6de5be82577e35849f67a0ead4410ae | [
"MIT"
] | null | null | null | potpourri/simi3.py | kmedian/potpourri | 54f7c517b6de5be82577e35849f67a0ead4410ae | [
"MIT"
] | 4 | 2019-03-29T22:37:51.000Z | 2019-04-05T04:44:44.000Z | potpourri/simi3.py | kmedian/potpourri | 54f7c517b6de5be82577e35849f67a0ead4410ae | [
"MIT"
] | null | null | null |
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import SGDRegressor
import scipy.stats as ss
model = Pipeline(steps=[
('scl', StandardScaler()),
('lin', SGDRegressor(
# Logistic Regression
loss = 'squared_loss',
penalty =... | 26.245283 | 77 | 0.586628 |
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import SGDRegressor
import scipy.stats as ss
model = Pipeline(steps=[
('scl', StandardScaler()),
('lin', SGDRegressor(
loss = 'squared_loss',
penalty = 'l1',
l1_rat... | true | true |
f74487f6f43c80372b54e730d65dd0446430a064 | 2,181 | py | Python | netests/converters/ping/arista/api.py | Netests/netests | 1a48bda461761c4ec854d6fa0c38629049009a4a | [
"MIT"
] | 14 | 2020-06-08T07:34:59.000Z | 2022-03-14T08:52:03.000Z | netests/converters/ping/arista/api.py | Netests/netests | 1a48bda461761c4ec854d6fa0c38629049009a4a | [
"MIT"
] | null | null | null | netests/converters/ping/arista/api.py | Netests/netests | 1a48bda461761c4ec854d6fa0c38629049009a4a | [
"MIT"
] | 3 | 2020-06-19T03:57:05.000Z | 2020-06-22T22:46:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pyeapi
from netests import log
from nornir.core.task import Result
from netests.constants import PING_DATA_HOST_KEY
from netests.converters.ping.ping_validator import _raise_exception_on_ping_cmd
def _arista_ping_api_exec(task):
c = pyeapi.connect(
tr... | 27.961538 | 79 | 0.538744 |
import pyeapi
from netests import log
from nornir.core.task import Result
from netests.constants import PING_DATA_HOST_KEY
from netests.converters.ping.ping_validator import _raise_exception_on_ping_cmd
def _arista_ping_api_exec(task):
c = pyeapi.connect(
transport=task.host.get('secure_api', 'https'),... | true | true |
f7448958125fb0669f33ef2b11b03289223ff520 | 94,666 | py | Python | pyvcloud/vcd/vapp.py | 0z-cloud/pyvcloud | 4ec9edd53598fff64970f65a1c41ae8329d51e9f | [
"Apache-2.0"
] | null | null | null | pyvcloud/vcd/vapp.py | 0z-cloud/pyvcloud | 4ec9edd53598fff64970f65a1c41ae8329d51e9f | [
"Apache-2.0"
] | null | null | null | pyvcloud/vcd/vapp.py | 0z-cloud/pyvcloud | 4ec9edd53598fff64970f65a1c41ae8329d51e9f | [
"Apache-2.0"
] | null | null | null | # VMware vCloud Director Python SDK
# Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | 43.424771 | 111 | 0.61868 |
from copy import deepcopy
from lxml import etree
from lxml import objectify
from pyvcloud.vcd.acl import Acl
from pyvcloud.vcd.client import E
from pyvcloud.vcd.client import E_OVF
from pyvcloud.vcd.client import EntityType
from pyvcloud.vcd.client import FenceMode
from pyvcloud.vcd.client import find_... | true | true |
f7448966794b18b65371725e5911ed52e8e820f5 | 4,136 | py | Python | RBM/Base.py | christianb93/MachineLearning | 2cfc344025bc27f74800973e05e79418420615cf | [
"MIT"
] | 16 | 2019-04-17T08:15:26.000Z | 2021-04-28T08:28:24.000Z | RBM/Base.py | dnzengou/MachineLearning-1 | 30d3b182d33f19b210aa393208236e626eaf5f6a | [
"MIT"
] | 1 | 2020-05-09T18:27:41.000Z | 2020-05-09T18:27:41.000Z | RBM/Base.py | dnzengou/MachineLearning-1 | 30d3b182d33f19b210aa393208236e626eaf5f6a | [
"MIT"
] | 4 | 2019-08-15T22:10:13.000Z | 2020-05-09T18:25:51.000Z | #####################################################
#
# Base class for restricted Boltzmann machines
#
#
# Copyright (c) 2018 christianb93
# 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 Softwa... | 32.566929 | 128 | 0.575193 | true | true | |
f7448a71c3168af12638e2dfed6518817b50b0f5 | 5,834 | py | Python | tests/components/vizio/conftest.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 4 | 2020-07-29T17:47:10.000Z | 2020-09-16T13:39:13.000Z | tests/components/vizio/conftest.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 38 | 2020-07-23T07:14:17.000Z | 2022-03-31T06:01:46.000Z | tests/components/vizio/conftest.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 5 | 2020-03-29T00:29:13.000Z | 2021-09-06T20:58:40.000Z | """Configure py.test."""
import pytest
from pyvizio.const import DEVICE_CLASS_SPEAKER, MAX_VOLUME
from .const import (
ACCESS_TOKEN,
APP_LIST,
CH_TYPE,
CURRENT_APP_CONFIG,
CURRENT_EQ,
CURRENT_INPUT,
EQ_LIST,
INPUT_LIST,
INPUT_LIST_WITH_APPS,
MODEL,
RESPONSE_TOKEN,
UNIQUE... | 31.365591 | 93 | 0.709119 | import pytest
from pyvizio.const import DEVICE_CLASS_SPEAKER, MAX_VOLUME
from .const import (
ACCESS_TOKEN,
APP_LIST,
CH_TYPE,
CURRENT_APP_CONFIG,
CURRENT_EQ,
CURRENT_INPUT,
EQ_LIST,
INPUT_LIST,
INPUT_LIST_WITH_APPS,
MODEL,
RESPONSE_TOKEN,
UNIQUE_ID,
VERSION,
Moc... | true | true |
f7448b03984750280d03f417ca0424913a1a878c | 267 | py | Python | app/__init__.py | gfborges/uol-unique-user-ml | 4deb47a7e83d22fcba9de8bba3243dd4b6fee4a3 | [
"MIT"
] | null | null | null | app/__init__.py | gfborges/uol-unique-user-ml | 4deb47a7e83d22fcba9de8bba3243dd4b6fee4a3 | [
"MIT"
] | null | null | null | app/__init__.py | gfborges/uol-unique-user-ml | 4deb47a7e83d22fcba9de8bba3243dd4b6fee4a3 | [
"MIT"
] | null | null | null | from flask import Flask
from app.models import SingletonModel
app = Flask(__name__)
def create_app():
from dotenv import load_dotenv
load_dotenv()
from app.router import bp
app.register_blueprint(bp)
SingletonModel.load_models()
return app
| 19.071429 | 37 | 0.741573 | from flask import Flask
from app.models import SingletonModel
app = Flask(__name__)
def create_app():
from dotenv import load_dotenv
load_dotenv()
from app.router import bp
app.register_blueprint(bp)
SingletonModel.load_models()
return app
| true | true |
f7448c3a4b5bf0a7d89f4aff4e3d4ea3aba157ea | 3,918 | py | Python | samples/extract_person.py | shu-yusa/Mask_RCNN | 710caa6746732379f5007f005a353e66490582f5 | [
"MIT"
] | null | null | null | samples/extract_person.py | shu-yusa/Mask_RCNN | 710caa6746732379f5007f005a353e66490582f5 | [
"MIT"
] | null | null | null | samples/extract_person.py | shu-yusa/Mask_RCNN | 710caa6746732379f5007f005a353e66490582f5 | [
"MIT"
] | null | null | null | import os
import sys
import random
import math
import numpy as np
import skimage.io
import matplotlib
import matplotlib.pyplot as plt
import cv2
import glob
import moviepy.editor as mp
# Root directory of the project
ROOT_DIR = os.path.abspath("../")
# Import Mask RCNN
sys.path.append(ROOT_DIR) # To find local versi... | 33.487179 | 88 | 0.641143 | import os
import sys
import random
import math
import numpy as np
import skimage.io
import matplotlib
import matplotlib.pyplot as plt
import cv2
import glob
import moviepy.editor as mp
ROOT_DIR = os.path.abspath("../")
sys.path.append(ROOT_DIR)
from mrcnn import utils
import mrcnn.model as modellib
from mrcnn imp... | true | true |
f7448c70f8073700d5af75e5104c7cb4280553e9 | 1,585 | py | Python | src/flip_flop_operator/flip_flop.py | techdragon/python-flip-flop-operator | d004eddf4c12c18eed1d354fb3fa9de833dd6447 | [
"MIT"
] | 1 | 2018-08-30T02:57:00.000Z | 2018-08-30T02:57:00.000Z | src/flip_flop_operator/flip_flop.py | techdragon/python-flip-flop-operator | d004eddf4c12c18eed1d354fb3fa9de833dd6447 | [
"MIT"
] | null | null | null | src/flip_flop_operator/flip_flop.py | techdragon/python-flip-flop-operator | d004eddf4c12c18eed1d354fb3fa9de833dd6447 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import inspect
import logging
from infix import or_infix
LOG = logging.getLogger(__name__)
@or_infix
def flip_flop(condition_one, condition_two):
"""
A Flip Flip Operator, as seen in Ruby and Perl.
Returns a boolean that flips from false to true when condition_one is True and
... | 33.723404 | 91 | 0.707256 |
import inspect
import logging
from infix import or_infix
LOG = logging.getLogger(__name__)
@or_infix
def flip_flop(condition_one, condition_two):
frame = inspect.currentframe()
unique_func_identifier = '_'.join([
str(frame.f_back.f_back.f_code.co_filename),
str(frame.f_back.f_back.f_code.co... | true | true |
f7448dc6bfb413f79db455dfb0050eadbea1dc23 | 2,312 | py | Python | nbviewer/formats.py | AI-Collaboratory/nbviewer | 1a40e04cc8aad67aa96bb840603f8f568c08d44d | [
"BSD-3-Clause-Clear"
] | 1,840 | 2015-01-01T13:25:44.000Z | 2022-03-17T08:33:01.000Z | nbviewer/formats.py | AI-Collaboratory/nbviewer | 1a40e04cc8aad67aa96bb840603f8f568c08d44d | [
"BSD-3-Clause-Clear"
] | 605 | 2015-01-01T16:45:01.000Z | 2022-03-14T15:25:25.000Z | nbviewer/formats.py | AI-Collaboratory/nbviewer | 1a40e04cc8aad67aa96bb840603f8f568c08d44d | [
"BSD-3-Clause-Clear"
] | 513 | 2015-01-07T20:54:49.000Z | 2022-02-17T16:04:30.000Z | # -----------------------------------------------------------------------------
# Copyright (C) Jupyter Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
# ------------------------------------------------------------... | 32.56338 | 85 | 0.53936 |
def default_formats():
def test_slides(nb, json):
for cell in nb.cells:
if (
"metadata" in cell
and "slideshow" in cell.metadata
and cell.metadata.slideshow.get("slide_type", "-") != "-"
):
return True
r... | true | true |
f7448e08ae049ee4461a0da43704e2d7980b5c9d | 1,707 | py | Python | tools/check_env.py | hanrui1sensetime/mmdeploy | f2594c624b67910e55e24418832bd96685425b2f | [
"Apache-2.0"
] | 1 | 2021-12-30T06:29:46.000Z | 2021-12-30T06:29:46.000Z | tools/check_env.py | wwjwy/mmdeploy | c6fccd0121618c8c4dc07f49823c377003475040 | [
"Apache-2.0"
] | null | null | null | tools/check_env.py | wwjwy/mmdeploy | c6fccd0121618c8c4dc07f49823c377003475040 | [
"Apache-2.0"
] | 1 | 2022-02-10T04:31:10.000Z | 2022-02-10T04:31:10.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import logging
from mmcv.utils import collect_env as collect_base_env
from mmcv.utils import get_git_hash
import mmdeploy
def collect_env():
"""Collect the information of the running environments."""
env_info = collect_base_env()
env_info['MMDeployment'] =... | 27.532258 | 79 | 0.684241 |
import logging
from mmcv.utils import collect_env as collect_base_env
from mmcv.utils import get_git_hash
import mmdeploy
def collect_env():
env_info = collect_base_env()
env_info['MMDeployment'] = f'{mmdeploy.__version__}+{get_git_hash()[:7]}'
return env_info
def check_backend():
try:
i... | true | true |
f7448e76a6e33a345bcc1d1b30c3094f3be9fb61 | 5,959 | py | Python | DJI_drone_barometer_altitude_for_PhotoScan.py | nangnh/PhotoScan_Scripts | 1feb93026b5bddecd34373c8891b86be99ef238f | [
"MIT"
] | 1 | 2017-10-18T00:10:21.000Z | 2017-10-18T00:10:21.000Z | DJI_drone_barometer_altitude_for_PhotoScan.py | nangnh/PhotoScan_Scripts | 1feb93026b5bddecd34373c8891b86be99ef238f | [
"MIT"
] | null | null | null | DJI_drone_barometer_altitude_for_PhotoScan.py | nangnh/PhotoScan_Scripts | 1feb93026b5bddecd34373c8891b86be99ef238f | [
"MIT"
] | 3 | 2017-10-02T23:41:46.000Z | 2021-08-15T14:41:27.000Z | #!/usr/bin/env python3
# DJI_drone_barometer_altitide_for_PhotoScan(input_directory, output_file_name, [-recursive])
# Grab barometer altitude from DJI jpegs and create
# a text file to use them with Agisoft PhotoScan.
# The GPS altitude on most DJI drones is so bad you
# can't use it with PhotoScan. Better to use ... | 42.870504 | 94 | 0.540527 |
# barometer altitude, which will need an offset if
# you did not take off from sea level.
import glob
import sys
import os
import argparse
from PIL import Image
def get_exif_gps(image):
exif = image._getexif()
gps_out = {'lat':float('nan'), 'lon':float('nan'), 'alt':float('nan')}
if exif:
... | true | true |
f7448f164d943f9205f7ff40068c9d8aff1896f8 | 613 | py | Python | apps/sushi/migrations/0023_sushicredentials_last_updated_by.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | apps/sushi/migrations/0023_sushicredentials_last_updated_by.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | apps/sushi/migrations/0023_sushicredentials_last_updated_by.py | remocrevo/celus | 682b13168eb475d7f970502113e756e40a899877 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2019-10-21 07:13
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('sushi', '0022_sushi_cred... | 27.863636 | 122 | 0.690049 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('sushi', '0022_sushi_credentials_locking'),
]
operations = [
... | true | true |
f7448febf8cebef530d549e65762a8f44f8eec9c | 2,314 | gyp | Python | build/linux/unbundle/v8.gyp | pozdnyakov/chromium-crosswalk | 0fb25c7278bf1d93e53a3b0bcb75aa8b99d4b26e | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 7 | 2015-08-06T01:46:07.000Z | 2020-10-20T09:14:58.000Z | build/linux/unbundle/v8.gyp | pozdnyakov/chromium-crosswalk | 0fb25c7278bf1d93e53a3b0bcb75aa8b99d4b26e | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | build/linux/unbundle/v8.gyp | pozdnyakov/chromium-crosswalk | 0fb25c7278bf1d93e53a3b0bcb75aa8b99d4b26e | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 16 | 2015-01-08T01:47:24.000Z | 2022-02-25T06:06:06.000Z | # Copyright 2013 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | 35.6 | 72 | 0.643907 |
{
'includes': ['../../build/common.gypi'],
'targets': [
{
'target_name': 'v8',
'type': 'none',
'toolsets': ['host', 'target'],
'variables': {
'headers_root_path': '../../include',
'header_filenames': [
'v8-debug.h',
'v8-prepa... | true | true |
f744909d0150d81f9d0ce60dba89a0140ac31e65 | 1,039 | py | Python | manage.py | ericsallinger/ocr_osler | 7739ee9943e24c1fd3f626a143ad62663d3ba0ff | [
"MIT"
] | null | null | null | manage.py | ericsallinger/ocr_osler | 7739ee9943e24c1fd3f626a143ad62663d3ba0ff | [
"MIT"
] | 3 | 2020-06-07T20:41:24.000Z | 2020-07-09T22:15:32.000Z | manage.py | ericsallinger/ocr_osler | 7739ee9943e24c1fd3f626a143ad62663d3ba0ff | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
from pathlib import Path
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some... | 32.46875 | 77 | 0.658325 |
import os
import sys
from pathlib import Path
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django... | true | true |
f744916b1ddb5bd4015383ed1c9a16e3a58f66d3 | 65,728 | py | Python | core/domain/story_domain.py | tonadev/oppia | ba55bb58763ed01c21017e3c34b72e25302f3bd8 | [
"Apache-2.0"
] | 2 | 2021-05-24T10:23:32.000Z | 2021-08-22T18:50:14.000Z | core/domain/story_domain.py | tonadev/oppia | ba55bb58763ed01c21017e3c34b72e25302f3bd8 | [
"Apache-2.0"
] | 2 | 2021-02-05T15:41:53.000Z | 2021-02-26T16:38:32.000Z | core/domain/story_domain.py | tonadev/oppia | ba55bb58763ed01c21017e3c34b72e25302f3bd8 | [
"Apache-2.0"
] | 1 | 2017-12-06T19:41:49.000Z | 2017-12-06T19:41:49.000Z | # Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 39.595181 | 80 | 0.631862 |
from __future__ import absolute_import
from __future__ import unicode_literals
import copy
import functools
import json
import re
import android_validation_constants
from constants import constants
from core.domain import change_domain
from core.domain import fs_domain
from core.domain import fs_servic... | true | true |
f74491c60ad7411487d7485ccbfd1015420a2fac | 1,005 | py | Python | the_millionaire/users/admin.py | mrsaemir/the_millionaire | 3fe2c9c114b43648b1c2e039589733bbf778b7f6 | [
"MIT"
] | null | null | null | the_millionaire/users/admin.py | mrsaemir/the_millionaire | 3fe2c9c114b43648b1c2e039589733bbf778b7f6 | [
"MIT"
] | null | null | null | the_millionaire/users/admin.py | mrsaemir/the_millionaire | 3fe2c9c114b43648b1c2e039589733bbf778b7f6 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from the_millionaire.users.forms import UserChangeForm, UserCreationForm
User = get_user_model()
@admin.register(User)
class User... | 28.714286 | 74 | 0.559204 | from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from the_millionaire.users.forms import UserChangeForm, UserCreationForm
User = get_user_model()
@admin.register(User)
class User... | true | true |
f74492fae231c44459ed15f941ff3841cfa7987e | 19,791 | py | Python | python/eggroll/roll_site/roll_site.py | liszekei/eggroll | 6a8cc5e1c9106d2633dc415092151f921f003743 | [
"Apache-2.0"
] | null | null | null | python/eggroll/roll_site/roll_site.py | liszekei/eggroll | 6a8cc5e1c9106d2633dc415092151f921f003743 | [
"Apache-2.0"
] | null | null | null | python/eggroll/roll_site/roll_site.py | liszekei/eggroll | 6a8cc5e1c9106d2633dc415092151f921f003743 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 - now, Eggroll 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 ... | 44.474157 | 147 | 0.626042 |
import logging
import pickle
import threading
import time
from eggroll import __version__ as eggroll_version
from eggroll.core.conf_keys import RollSiteConfKeys, \
CoreConfKeys
from eggroll.core.datastructure import create_executor_pool
from eggroll.core.grpc.factory import GrpcChannelFactory
from e... | true | true |
f74493c6afa2df280574c1eabcf3559bc4208cd4 | 457 | py | Python | Q4/read.py | arpanmangal/Regression | 06969286d7db65a537e89ac37905310592542ca9 | [
"MIT"
] | null | null | null | Q4/read.py | arpanmangal/Regression | 06969286d7db65a537e89ac37905310592542ca9 | [
"MIT"
] | null | null | null | Q4/read.py | arpanmangal/Regression | 06969286d7db65a537e89ac37905310592542ca9 | [
"MIT"
] | null | null | null | """
Module for reading data from 'q4x.csv' and 'q4y.csv'
"""
import numpy as np
def loadData (x_file="../ass1_data/q4x.dat", y_file="../ass1_data/q4y.dat"):
"""
Loads the X, Y matrices.
"""
X = np.genfromtxt(x_file, delimiter=' ', dtype=int)
labels = np.genfromtxt(y_file, dtype=str)
Y = []
... | 20.772727 | 76 | 0.549234 |
import numpy as np
def loadData (x_file="../ass1_data/q4x.dat", y_file="../ass1_data/q4y.dat"):
X = np.genfromtxt(x_file, delimiter=' ', dtype=int)
labels = np.genfromtxt(y_file, dtype=str)
Y = []
for label in labels:
if (label == "Alaska"):
Y.append(0)
else:
... | true | true |
f74493fb8ff35c1840480038021304caa1379835 | 6,855 | py | Python | photons.py | mfkoerner/icarus | eb480596be127f760d10531d27569290df3e8ff9 | [
"MIT"
] | 2 | 2018-02-21T23:23:53.000Z | 2019-05-22T11:05:03.000Z | photons.py | mfkoerner/icarus | eb480596be127f760d10531d27569290df3e8ff9 | [
"MIT"
] | null | null | null | photons.py | mfkoerner/icarus | eb480596be127f760d10531d27569290df3e8ff9 | [
"MIT"
] | null | null | null | ########################################
# written for Python 3 #
# by Doug Fabini (fabini@mrl.ucsb.edu) #
########################################
'''
This script requires the following files to be located in 'baseDir':
- IBZKPT (to extract number of k points) POSSIBLY NO LONGER NEEDED
- DOSCAR (t... | 38.296089 | 144 | 0.65485 | Re[eps_iso] (eps_0), Im[eps_iso] (eps_0)')
def getSolarSpectrum():
d = np.loadtxt('data/ASTMG173.dat')
return d[:,0], d[:,2]
def nm2eV(lam):
h = 4.136e-15
c = 2.998e8
return h*c/(lam*1e-9)
def eV2nm(hnu):
h = 4.136e-15
c = 2.998e8
return h*c/hnu*1e9
def isotropic(sixElements):
xx, yy, zz, xy, yz,... | true | true |
f744955ccd4169b75ba7b9fcf3fcf0a9f1982d4d | 2,098 | py | Python | webview/win32_shared.py | vault-the/pywebview | 8608378ab62732d52640478c572c4f83994c0cbf | [
"BSD-3-Clause"
] | null | null | null | webview/win32_shared.py | vault-the/pywebview | 8608378ab62732d52640478c572c4f83994c0cbf | [
"BSD-3-Clause"
] | null | null | null | webview/win32_shared.py | vault-the/pywebview | 8608378ab62732d52640478c572c4f83994c0cbf | [
"BSD-3-Clause"
] | null | null | null | """
(C) 2014-2016 Roman Sirokov and contributors
Licensed under BSD license
http://github.com/r0x0r/pywebview/
"""
import sys
def set_ie_mode():
"""
By default hosted IE control emulates IE7 regardless which version of IE is installed. To fix this, a proper value
must be set for the executable.
See ... | 33.301587 | 133 | 0.609628 |
import sys
def set_ie_mode():
try:
import _winreg as winreg
except ImportError:
import winreg
def get_ie_mode():
ie_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Microsoft\Internet Explorer")
try:
version, type = winreg.QueryValueEx(ie_key, "... | true | true |
f74496e145f3b854e99aec096cd46ed010c8f8ec | 91 | py | Python | scoringhub/datacore/apps.py | bradenp34/scoringhub | e5397a9f1b9f33acb2480e7b6dd6ca893986569d | [
"BSD-3-Clause"
] | null | null | null | scoringhub/datacore/apps.py | bradenp34/scoringhub | e5397a9f1b9f33acb2480e7b6dd6ca893986569d | [
"BSD-3-Clause"
] | null | null | null | scoringhub/datacore/apps.py | bradenp34/scoringhub | e5397a9f1b9f33acb2480e7b6dd6ca893986569d | [
"BSD-3-Clause"
] | null | null | null | from django.apps import AppConfig
class DatacoreConfig(AppConfig):
name = 'datacore'
| 15.166667 | 33 | 0.758242 | from django.apps import AppConfig
class DatacoreConfig(AppConfig):
name = 'datacore'
| true | true |
f744976f49b78e8e6020799d6aeda8d58123d225 | 1,045 | py | Python | init.py | PabloCBX/Scrapper-Retail-CL | 17cdb7477972fa921bb7f5a8daf071953610f28c | [
"MIT"
] | null | null | null | init.py | PabloCBX/Scrapper-Retail-CL | 17cdb7477972fa921bb7f5a8daf071953610f28c | [
"MIT"
] | null | null | null | init.py | PabloCBX/Scrapper-Retail-CL | 17cdb7477972fa921bb7f5a8daf071953610f28c | [
"MIT"
] | null | null | null | import sqlite3
import requests
from bs4 import BeautifulSoup
from datetime import datetime
conn = None
conn = sqlite3.connect("db/db_scrapper.db")
def showAll():
cur = conn.cursor()
cur.execute("SELECT * FROM LOG_TEST")
rows = cur.fetchall()
for row in rows:
print(row)
... | 20.096154 | 67 | 0.595215 | import sqlite3
import requests
from bs4 import BeautifulSoup
from datetime import datetime
conn = None
conn = sqlite3.connect("db/db_scrapper.db")
def showAll():
cur = conn.cursor()
cur.execute("SELECT * FROM LOG_TEST")
rows = cur.fetchall()
for row in rows:
print(row)
... | true | true |
f74497e6ca3d1f56f8274d6e1145c7c236bb12f2 | 685 | py | Python | app/core/migrations/0003_ingredient.py | tomasz-zieba/recipe-app-api | 34749aa15dee40c3db332a0b8c0624127d82a939 | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | tomasz-zieba/recipe-app-api | 34749aa15dee40c3db332a0b8c0624127d82a939 | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | tomasz-zieba/recipe-app-api | 34749aa15dee40c3db332a0b8c0624127d82a939 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-10 08:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
n... | 28.541667 | 118 | 0.617518 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
name='Ingredient',
fields=[
... | true | true |
f744990cb307d91695791f416cec96d6f42c67f0 | 31,038 | py | Python | scripts/casechecker.py | framawiki/pywikibot | 9835260ef5f38ac83d3ce214c7d1abd594bea934 | [
"MIT"
] | null | null | null | scripts/casechecker.py | framawiki/pywikibot | 9835260ef5f38ac83d3ce214c7d1abd594bea934 | [
"MIT"
] | null | null | null | scripts/casechecker.py | framawiki/pywikibot | 9835260ef5f38ac83d3ce214c7d1abd594bea934 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Bot to find all pages on the wiki with mixed latin and cyrilic alphabets."""
#
# (C) Pywikibot team, 2006-2020
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
import codecs
from itertools import chain,... | 39.48855 | 79 | 0.469876 |
from __future__ import absolute_import, division, unicode_literals
import codecs
from itertools import chain, combinations
import os
import re
from string import ascii_letters
import sys
import pywikibot
from pywikibot import i18n
from pywikibot.data import api
from pywikibot.tools import first_lower, first_... | true | true |
f7449ae06c039dfbf246d3e88f6402d7239677de | 283 | py | Python | pontoon/projects/forms.py | foss4/pontoon | 0503cc78f00e1e9d23c1ca885fe74a627563fc82 | [
"BSD-3-Clause"
] | 1,145 | 2015-05-15T01:08:16.000Z | 2022-03-31T14:23:45.000Z | pontoon/projects/forms.py | foss4/pontoon | 0503cc78f00e1e9d23c1ca885fe74a627563fc82 | [
"BSD-3-Clause"
] | 1,365 | 2015-05-04T21:54:18.000Z | 2022-03-30T16:53:49.000Z | pontoon/projects/forms.py | foss4/pontoon | 0503cc78f00e1e9d23c1ca885fe74a627563fc82 | [
"BSD-3-Clause"
] | 667 | 2015-05-04T21:33:45.000Z | 2022-03-30T10:25:33.000Z | from django import forms
from django.core import validators
from pontoon.base.forms import HtmlField
class NotificationsForm(forms.Form):
message = HtmlField()
selected_locales = forms.CharField(
validators=[validators.validate_comma_separated_integer_list]
)
| 23.583333 | 69 | 0.777385 | from django import forms
from django.core import validators
from pontoon.base.forms import HtmlField
class NotificationsForm(forms.Form):
message = HtmlField()
selected_locales = forms.CharField(
validators=[validators.validate_comma_separated_integer_list]
)
| true | true |
f7449b435786e60637adc52b5ff051038215d20e | 10,804 | py | Python | otcextensions/tests/unit/osclient/load_balancer/v1/test_load_balancer.py | spielkind/python-otcextensions | 47ba917df2d85db6cb347f2038fd7f79a8a806b7 | [
"Apache-2.0"
] | null | null | null | otcextensions/tests/unit/osclient/load_balancer/v1/test_load_balancer.py | spielkind/python-otcextensions | 47ba917df2d85db6cb347f2038fd7f79a8a806b7 | [
"Apache-2.0"
] | null | null | null | otcextensions/tests/unit/osclient/load_balancer/v1/test_load_balancer.py | spielkind/python-otcextensions | 47ba917df2d85db6cb347f2038fd7f79a8a806b7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Nebula 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... | 28.582011 | 78 | 0.608941 |
import mock
from otcextensions.common import sdk_utils
from otcextensions.osclient.load_balancer.v1 import load_balancer
from otcextensions.tests.unit.osclient.load_balancer.v1 import fakes
class TestListLoadBalancer(fakes.TestLoadBalancer):
_objects = fakes.FakeLoadBalancer.create_multiple(3)
... | true | true |
f7449b871c6f2e539f729807eed72649ec3a1bde | 4,807 | py | Python | venv/lib/python2.7/site-packages/nltk/corpus/util.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | 3 | 2019-04-09T22:59:33.000Z | 2019-06-14T09:23:24.000Z | nltk/corpus/util.py | guker/nltk | 085399ea9d53318ae6e8568909fa55f0d905ad5a | [
"Apache-2.0"
] | null | null | null | nltk/corpus/util.py | guker/nltk | 085399ea9d53318ae6e8568909fa55f0d905ad5a | [
"Apache-2.0"
] | null | null | null | # Natural Language Toolkit: Corpus Reader Utility Functions
#
# Copyright (C) 2001-2014 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
######################################################################
#{ Lazy Corpus Loader
#############... | 37.554688 | 88 | 0.63678 | true | true | |
f7449d2ec27501315033481e7a1116e168d7e396 | 1,737 | py | Python | main.py | Raphael9999/scraping-section-232 | 122d22842c30effd2d11f1304fdd8d30afbb3efa | [
"Unlicense"
] | null | null | null | main.py | Raphael9999/scraping-section-232 | 122d22842c30effd2d11f1304fdd8d30afbb3efa | [
"Unlicense"
] | null | null | null | main.py | Raphael9999/scraping-section-232 | 122d22842c30effd2d11f1304fdd8d30afbb3efa | [
"Unlicense"
] | null | null | null | import mine232 as mn
import pandas as pd
import datetime # duration calculation
from os import path
import time # for the sleep at the end of the loop
import gc # garbage collection, freeing memory
# input parameters
gfrom = 18681
gto = 20001 # gfrom+2000
inc = 100
# variable initiation
fromto = str(gfrom)+'-'+st... | 35.44898 | 121 | 0.630397 | import mine232 as mn
import pandas as pd
import datetime
from os import path
import time
import gc
gfrom = 18681
gto = 20001
inc = 100
fromto = str(gfrom)+'-'+str(gto)
res_file = r'result\extract232_'+fromto+'.csv'
lfrom = gfrom
lto = min(lfrom+inc, gto)
hbool = True w()
while lfrom < lto:
t... | true | true |
f7449d6892cd7c03d80411b38ee8ed1e2b897f83 | 11,755 | py | Python | sdk/python/pulumi_azure_native/network/v20191201/get_connection_monitor.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20191201/get_connection_monitor.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20191201/get_connection_monitor.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 38.667763 | 362 | 0.659634 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetConnectionMonitorResult',
'AwaitableGetConnectionMonitorResult',
'get_connection_monitor',
]
@pulumi.output_type
clas... | true | true |
f7449e0f3dcbe0569bf13e5b2c72734b591b27c3 | 7,544 | py | Python | conta/main/tests/views/test_filtro_asientos.py | osso73/contabilidad | babdedfdb47b2b4fd01a09e2db9db5d21bbc88f0 | [
"MIT"
] | null | null | null | conta/main/tests/views/test_filtro_asientos.py | osso73/contabilidad | babdedfdb47b2b4fd01a09e2db9db5d21bbc88f0 | [
"MIT"
] | 23 | 2021-12-29T21:41:37.000Z | 2022-03-31T10:01:54.000Z | conta/main/tests/views/test_filtro_asientos.py | osso73/contabilidad | babdedfdb47b2b4fd01a09e2db9db5d21bbc88f0 | [
"MIT"
] | 1 | 2022-02-18T19:58:52.000Z | 2022-02-18T19:58:52.000Z | from main.models import FiltroMovimientos
from fixtures_views import *
class TestFiltroAsientos():
@pytest.fixture
def create_filter(self):
# Create filter with default values (all blanks)
return FiltroMovimientos.objects.create()
@pytest.fixture
def create_and_populate_filter(self):... | 38.687179 | 119 | 0.653632 | from main.models import FiltroMovimientos
from fixtures_views import *
class TestFiltroAsientos():
@pytest.fixture
def create_filter(self):
return FiltroMovimientos.objects.create()
@pytest.fixture
def create_and_populate_filter(self):
f = FiltroMovimientos.objects.create(
... | true | true |
f7449f29cc472b1ac338e6f33e4ec245f85c6a1a | 15,084 | py | Python | tests/test_corpus.py | phamlehuy53/Montreal-Forced-Aligner | 2b4330b2d4c7d0db9c7d0586bb516bba049ceadd | [
"MIT"
] | null | null | null | tests/test_corpus.py | phamlehuy53/Montreal-Forced-Aligner | 2b4330b2d4c7d0db9c7d0586bb516bba049ceadd | [
"MIT"
] | null | null | null | tests/test_corpus.py | phamlehuy53/Montreal-Forced-Aligner | 2b4330b2d4c7d0db9c7d0586bb516bba049ceadd | [
"MIT"
] | null | null | null | import os
import shutil
from montreal_forced_aligner.corpus import AlignableCorpus, TranscribeCorpus
from montreal_forced_aligner.dictionary import Dictionary
from montreal_forced_aligner.config.train_config import train_yaml_to_config
def test_basic(basic_dict_path, basic_corpus_dir, generated_dir, default_feature_... | 42.490141 | 122 | 0.747812 | import os
import shutil
from montreal_forced_aligner.corpus import AlignableCorpus, TranscribeCorpus
from montreal_forced_aligner.dictionary import Dictionary
from montreal_forced_aligner.config.train_config import train_yaml_to_config
def test_basic(basic_dict_path, basic_corpus_dir, generated_dir, default_feature_... | true | true |
f7449f576b15880fd61d08c25f1f52586eb48072 | 2,060 | py | Python | test/test_simple.py | bugov/pythonish-validator | b262f2c99c60a25766668dedc801ecd5bd85ea52 | [
"BSD-3-Clause"
] | 3 | 2019-04-06T15:03:06.000Z | 2020-02-07T10:21:50.000Z | test/test_simple.py | bugov/pythonish-validator | b262f2c99c60a25766668dedc801ecd5bd85ea52 | [
"BSD-3-Clause"
] | 2 | 2019-09-29T16:49:48.000Z | 2019-10-23T18:25:39.000Z | test/test_simple.py | bugov/pythonish-validator | b262f2c99c60a25766668dedc801ecd5bd85ea52 | [
"BSD-3-Clause"
] | null | null | null | from pythonish_validator.common import Validator
DATA_SAMPLE = {
"hero": {
"name": "R2-D2",
"friends": [
{
"name": "Luke Skywalker",
"appearsIn": ["NEWHOPE", "EMPIRE", "JEDI"],
"friends": [
{"name": "Han Solo"},
... | 23.146067 | 59 | 0.346117 | from pythonish_validator.common import Validator
DATA_SAMPLE = {
"hero": {
"name": "R2-D2",
"friends": [
{
"name": "Luke Skywalker",
"appearsIn": ["NEWHOPE", "EMPIRE", "JEDI"],
"friends": [
{"name": "Han Solo"},
... | true | true |
f7449f70a3ca0d8feac6b6b78e9f2cbc4a41c11d | 458 | py | Python | TravelWebsite/travello/migrations/0024_auto_20200310_0017.py | DSAnup/Django | 76025d181bafbb41783912577f80ec728884549d | [
"MIT"
] | 1 | 2020-03-15T05:22:30.000Z | 2020-03-15T05:22:30.000Z | TravelWebsite/travello/migrations/0024_auto_20200310_0017.py | DSAnup/Django | 76025d181bafbb41783912577f80ec728884549d | [
"MIT"
] | null | null | null | TravelWebsite/travello/migrations/0024_auto_20200310_0017.py | DSAnup/Django | 76025d181bafbb41783912577f80ec728884549d | [
"MIT"
] | null | null | null | # Generated by Django 3.0.1 on 2020-03-09 18:17
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('travello', '0023_auto_20200310_0007'),
]
operations = [
migrations.AlterField(
model_name='team',
na... | 22.9 | 109 | 0.617904 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('travello', '0023_auto_20200310_0007'),
]
operations = [
migrations.AlterField(
model_name='team',
name='date',
field=models.DateTimeFie... | true | true |
f7449fd92a6daf677d4c57906395c4cb3a29258f | 5,460 | py | Python | sdk/python/pulumi_azure_nextgen/management/v20180301preview/get_entity.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/management/v20180301preview/get_entity.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/management/v20180301preview/get_entity.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 49.636364 | 667 | 0.695055 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetEntityResult',
'AwaitableGetEntityResult',
'get_entity',
]
@pulumi.output_type
class GetEntityResult:
def __init_... | true | true |
f744a24c64bb2d9716917d8814d998dd0eff2899 | 8,834 | py | Python | msgraph-cli-extensions/v1_0/identitysignins_v1_0/azext_identitysignins_v1_0/vendored_sdks/identitysignins/_identity_sign_ins.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/v1_0/identitysignins_v1_0/azext_identitysignins_v1_0/vendored_sdks/identitysignins/_identity_sign_ins.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/v1_0/identitysignins_v1_0/azext_identitysignins_v1_0/vendored_sdks/identitysignins/_identity_sign_ins.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"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 ... | 58.118421 | 148 | 0.781073 |
from typing import TYPE_CHECKING
from azure.mgmt.core import ARMPipelineClient
from msrest import Deserializer, Serializer
if TYPE_CHECKING:
from typing import Any, Optional
from azure.core.credentials import TokenCredential
from ._configuration import IdentitySignInsConfiguration
from .operati... | true | true |
f744a3684c626ea0ff83d763c4330046e48ec17b | 2,745 | py | Python | tests/hacsbase/test_hacsbase_data.py | ludeeus/HARM | 9c4f69d7cd7c240c2aa66c150723536b533b9f2f | [
"MIT"
] | 456 | 2019-03-02T22:46:27.000Z | 2019-10-23T18:34:23.000Z | tests/hacsbase/test_hacsbase_data.py | ludeeus/HARM | 9c4f69d7cd7c240c2aa66c150723536b533b9f2f | [
"MIT"
] | 573 | 2019-03-02T18:42:28.000Z | 2019-10-24T07:52:38.000Z | tests/hacsbase/test_hacsbase_data.py | ludeeus/harm | 55794176fccf55321780decf9ef354e91a41d1b9 | [
"MIT"
] | 275 | 2019-05-22T06:27:25.000Z | 2019-10-23T11:42:51.000Z | """Data Test Suite."""
import pytest
from custom_components.hacs.base import HacsRepositories
from custom_components.hacs.enums import HacsGitHubRepo
from custom_components.hacs.utils.data import HacsData
from tests.async_mock import patch
@pytest.mark.asyncio
async def test_hacs_data_async_write1(hacs, repository)... | 33.072289 | 100 | 0.67286 | import pytest
from custom_components.hacs.base import HacsRepositories
from custom_components.hacs.enums import HacsGitHubRepo
from custom_components.hacs.utils.data import HacsData
from tests.async_mock import patch
@pytest.mark.asyncio
async def test_hacs_data_async_write1(hacs, repository):
data = HacsData(h... | true | true |
f744a3ca4156c1131756a2321a179f1680e34ab4 | 921 | py | Python | test/test_agent_in_hostgroup.py | dcompane/controlm_py | c521208be2f00303383bb32ca5eb2b7ff91999d3 | [
"MIT"
] | 2 | 2020-03-20T18:24:23.000Z | 2021-03-05T22:05:04.000Z | test/test_agent_in_hostgroup.py | dcompane/controlm_py | c521208be2f00303383bb32ca5eb2b7ff91999d3 | [
"MIT"
] | null | null | null | test/test_agent_in_hostgroup.py | dcompane/controlm_py | c521208be2f00303383bb32ca5eb2b7ff91999d3 | [
"MIT"
] | 1 | 2021-05-27T15:54:37.000Z | 2021-05-27T15:54:37.000Z | # coding: utf-8
"""
Control-M Services
Provides access to BMC Control-M Services # noqa: E501
OpenAPI spec version: 9.20.220
Contact: customer_support@bmc.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import con... | 23.025 | 88 | 0.712269 |
from __future__ import absolute_import
import unittest
import controlm_py
from controlm_py.models.agent_in_hostgroup import AgentInHostgroup
from controlm_py.rest import ApiException
class TestAgentInHostgroup(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def... | true | true |
f744a4563621274c5ab941cc0a3b1b762f97be1d | 51 | py | Python | autoextract/__version__.py | aceraspire123/zyte-autoextract | 6013e813484ea7ed775b5c509480c8e0a87cff72 | [
"BSD-3-Clause"
] | null | null | null | autoextract/__version__.py | aceraspire123/zyte-autoextract | 6013e813484ea7ed775b5c509480c8e0a87cff72 | [
"BSD-3-Clause"
] | null | null | null | autoextract/__version__.py | aceraspire123/zyte-autoextract | 6013e813484ea7ed775b5c509480c8e0a87cff72 | [
"BSD-3-Clause"
] | null | null | null | __version__ = '0.7.1'
autoextract/__version__.py
| 10.2 | 26 | 0.745098 | __version__ = '0.7.1'
autoextract/__version__.py
| true | true |
f744a48ddac7206f442e5dbb74992781a860657a | 982 | py | Python | src/virtual-wan/azext_vwan/vendored_sdks/v2018_08_01/v2018_08_01/models/load_balancer_sku.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2018_08_01/v2018_08_01/models/load_balancer_sku.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/virtual-wan/azext_vwan/vendored_sdks/v2018_08_01/v2018_08_01/models/load_balancer_sku.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # 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 ... | 31.677419 | 76 | 0.57943 |
from msrest.serialization import Model
class LoadBalancerSku(Model):
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
}
def __init__(self, **kwargs):
super(LoadBalancerSku, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
| true | true |
f744a4ee1dbc80c7495f2ccaaf1bdda4f1515390 | 30,088 | py | Python | runtime/runtime.py | nirandaperera/pipedream | bc05a4e8ce150f681ba6066805604873a3a7cf97 | [
"MIT"
] | null | null | null | runtime/runtime.py | nirandaperera/pipedream | bc05a4e8ce150f681ba6066805604873a3a7cf97 | [
"MIT"
] | null | null | null | runtime/runtime.py | nirandaperera/pipedream | bc05a4e8ce150f681ba6066805604873a3a7cf97 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import collections
import itertools
import time
import torch
import torch.distributed as dist
import communication
import runtime_utilities
IMAGE_CLASSIFICATION = "image_classification"
TRANSLATION = "translation"
SPEECH_TO_TEXT = "speech_to_te... | 42.437236 | 125 | 0.590834 |
import collections
import itertools
import time
import torch
import torch.distributed as dist
import communication
import runtime_utilities
IMAGE_CLASSIFICATION = "image_classification"
TRANSLATION = "translation"
SPEECH_TO_TEXT = "speech_to_text"
class ModulesWithDependencies:
def __init__(self, modules_wit... | true | true |
f744a50190174989ec4b40a2ab2ea1dabbb1a71a | 4,152 | py | Python | tests/test_app.py | LandRegistry/property-frontend-alpha | bde928c802a7efd8a0e18c041341e54d4cc89bc1 | [
"MIT"
] | null | null | null | tests/test_app.py | LandRegistry/property-frontend-alpha | bde928c802a7efd8a0e18c041341e54d4cc89bc1 | [
"MIT"
] | null | null | null | tests/test_app.py | LandRegistry/property-frontend-alpha | bde928c802a7efd8a0e18c041341e54d4cc89bc1 | [
"MIT"
] | 1 | 2021-04-11T06:06:39.000Z | 2021-04-11T06:06:39.000Z | from propertyfrontend.server import app
import mock
import unittest
import requests
import responses
from stubresponses import title
from stubresponses import search_results, test_two_search_results
class ViewPropertyTestCase(unittest.TestCase):
def setUp(self):
self.search_api = app.config['SEARCH_API']... | 41.939394 | 91 | 0.697977 | from propertyfrontend.server import app
import mock
import unittest
import requests
import responses
from stubresponses import title
from stubresponses import search_results, test_two_search_results
class ViewPropertyTestCase(unittest.TestCase):
def setUp(self):
self.search_api = app.config['SEARCH_API']... | true | true |
f744a5c754436e40da199b6067614dec21f0ec54 | 7,416 | py | Python | app/lib/scorecard/ncr_tab.py | jchrisfarris/antiope-scorecards | 82a1e228f4bd23f756c1dec8c0582fcde98de564 | [
"Apache-2.0"
] | 1 | 2020-09-23T21:40:16.000Z | 2020-09-23T21:40:16.000Z | app/lib/scorecard/ncr_tab.py | jchrisfarris/antiope-scorecards | 82a1e228f4bd23f756c1dec8c0582fcde98de564 | [
"Apache-2.0"
] | null | null | null | app/lib/scorecard/ncr_tab.py | jchrisfarris/antiope-scorecards | 82a1e228f4bd23f756c1dec8c0582fcde98de564 | [
"Apache-2.0"
] | 3 | 2020-07-11T19:18:12.000Z | 2021-08-14T17:43:06.000Z | from openpyxl.formatting.rule import FormulaRule
from openpyxl.styles import Font
from openpyxl.utils import get_column_letter
from openpyxl.worksheet.worksheet import Worksheet
from lib.dynamodb import config_table
class NcrTabFormatting():
TITLE = 'Non Compliant Resources'
FREEZE = 'A2'
VALID_EXCLUSIO... | 33.556561 | 135 | 0.592233 | from openpyxl.formatting.rule import FormulaRule
from openpyxl.styles import Font
from openpyxl.utils import get_column_letter
from openpyxl.worksheet.worksheet import Worksheet
from lib.dynamodb import config_table
class NcrTabFormatting():
TITLE = 'Non Compliant Resources'
FREEZE = 'A2'
VALID_EXCLUSIO... | true | true |
f744a679ec9d8b14d1b0dc0ae835aa27a86ee16f | 625 | py | Python | Markov Reversal.py | danielhanchen/Reversing_Markov_Chains | 5702521a2c98e3fc3882bdff882c6c1a54d57416 | [
"MIT"
] | 3 | 2017-11-11T12:23:39.000Z | 2020-08-26T12:43:29.000Z | Markov Reversal.py | danielhanchen/Reversing_Markov_Chains | 5702521a2c98e3fc3882bdff882c6c1a54d57416 | [
"MIT"
] | null | null | null | Markov Reversal.py | danielhanchen/Reversing_Markov_Chains | 5702521a2c98e3fc3882bdff882c6c1a54d57416 | [
"MIT"
] | null | null | null | from numpy import *
from numpy.linalg import *
def reverse(prev_t, prev_pop, next_pop):
length = len(prev_t)
top = prev_t*(multiply(prev_pop, eye(length)))
bot = multiply(next_pop, ones((length,length)))
return (top/bot).T
prev_t = matrix([[0.4, 0.2, 0.4],
[0.1, 0, 0.9],
... | 20.833333 | 51 | 0.6336 | from numpy import *
from numpy.linalg import *
def reverse(prev_t, prev_pop, next_pop):
length = len(prev_t)
top = prev_t*(multiply(prev_pop, eye(length)))
bot = multiply(next_pop, ones((length,length)))
return (top/bot).T
prev_t = matrix([[0.4, 0.2, 0.4],
[0.1, 0, 0.9],
... | true | true |
f744a6cbca75931bb8f89f9b71f200fbc80ef549 | 1,460 | py | Python | ENV/lib/python3.5/site-packages/pyrogram/api/types/contacts/top_peers_not_modified.py | block1o1/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | 4 | 2021-10-14T21:22:25.000Z | 2022-03-12T19:58:48.000Z | ENV/lib/python3.5/site-packages/pyrogram/api/types/contacts/top_peers_not_modified.py | inevolin/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | null | null | null | ENV/lib/python3.5/site-packages/pyrogram/api/types/contacts/top_peers_not_modified.py | inevolin/CryptoPredicted | 7f660cdc456fb8252b3125028f31fd6f5a3ceea5 | [
"MIT"
] | 1 | 2022-03-15T22:52:53.000Z | 2022-03-15T22:52:53.000Z | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free S... | 28.076923 | 113 | 0.687671 |
from io import BytesIO
from pyrogram.api.core import *
class TopPeersNotModified(Object):
ID = 0xde266ef5
def __init__(self):
pass
@staticmethod
def read(b: BytesIO, *args) -> "TopPeersNotModified":
return TopPeersNotModified()
def write(sel... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.