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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3ba262bbd3967017630478ef1f6306fe297aaa | 20,382 | py | Python | TF/esp_tf_utils.py | Rahul-chunduru/meanfield-theory-of-activation-functions | 97abc52b25d7a57dc75ce21dcccc419f58a393d4 | [
"Apache-2.0"
] | 6 | 2018-06-12T08:35:43.000Z | 2019-03-16T05:06:11.000Z | TF/esp_tf_utils.py | Rahul-chunduru/meanfield-theory-of-activation-functions | 97abc52b25d7a57dc75ce21dcccc419f58a393d4 | [
"Apache-2.0"
] | 1 | 2019-04-26T05:40:08.000Z | 2019-05-07T01:54:49.000Z | TF/esp_tf_utils.py | Rahul-chunduru/meanfield-theory-of-activation-functions | 97abc52b25d7a57dc75ce21dcccc419f58a393d4 | [
"Apache-2.0"
] | 2 | 2019-09-24T16:28:10.000Z | 2020-03-26T16:38:29.000Z | """
Helper functions for FFN with ESP
=================================================================
Author: Mirco Milletari <mirco@bambu.life> (2018)
Tensorflow implementation of a Feed Forward Deep network with ESP
activation, as defined in
"Expectation propagation: a probabilistic view of Deep Feed Forward Netw... | 38.529301 | 168 | 0.61883 |
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.python.framework import ops
def one_hot_econding(vect, N_classes, N_ch):
C = tf.constant(N_classes, name="C")
one_hot_matrix = tf.one_hot(vect-1, C, axis=0)
if N_ch != 0:
one_hot_matrix= t... | true | true |
1c3ba32c797e288fa66e9565e66e9de634959d0c | 314 | py | Python | tests/test_rpc.py | laoshan-tech/xray-rpc | 95034a012c32b4c915a9612cd21970fd40f08bfd | [
"MIT"
] | 1 | 2021-05-27T22:04:09.000Z | 2021-05-27T22:04:09.000Z | tests/test_rpc.py | laoshan-tech/xray-rpc | 95034a012c32b4c915a9612cd21970fd40f08bfd | [
"MIT"
] | 1 | 2021-04-11T15:38:43.000Z | 2021-04-12T02:49:44.000Z | tests/test_rpc.py | laoshan-tech/xray-rpc | 95034a012c32b4c915a9612cd21970fd40f08bfd | [
"MIT"
] | null | null | null | class TestRPC(object):
def test_import(self):
from xray_rpc.app.stats.command import command_pb2_grpc as stats_command_pb2_grpc
from xray_rpc.core import config_pb2
assert issubclass(stats_command_pb2_grpc.StatsServiceStub, object)
assert issubclass(config_pb2.Config, object)
| 39.25 | 89 | 0.761146 | class TestRPC(object):
def test_import(self):
from xray_rpc.app.stats.command import command_pb2_grpc as stats_command_pb2_grpc
from xray_rpc.core import config_pb2
assert issubclass(stats_command_pb2_grpc.StatsServiceStub, object)
assert issubclass(config_pb2.Config, object)
| true | true |
1c3ba5e8ee78c0e5bcaca6f4cc049fae77128149 | 1,422 | py | Python | tools/scripts/dearimgui_update.py | mingw4/Cinder | 447f1366bb4c4a4821055043fc4945da4139c1c9 | [
"BSD-2-Clause"
] | 3,494 | 2015-01-02T08:42:09.000Z | 2022-03-31T14:16:23.000Z | tools/scripts/dearimgui_update.py | mingw4/Cinder | 447f1366bb4c4a4821055043fc4945da4139c1c9 | [
"BSD-2-Clause"
] | 1,284 | 2015-01-02T07:31:47.000Z | 2022-03-30T02:06:43.000Z | tools/scripts/dearimgui_update.py | mingw4/Cinder | 447f1366bb4c4a4821055043fc4945da4139c1c9 | [
"BSD-2-Clause"
] | 780 | 2015-01-02T22:14:29.000Z | 2022-03-30T00:16:56.000Z | import glob, os, shutil, sys
# "Usage: dearimgui_update.py SOURCE DEST"
im_path = os.path.abspath(sys.argv[1])
ci_path = os.path.abspath(sys.argv[2])
def copy_files(src_dir, target_dir, extension):
files = glob.iglob(os.path.join(src_dir, extension))
for src in files:
if os.path.isfile(src):
... | 39.5 | 109 | 0.642053 | import glob, os, shutil, sys
im_path = os.path.abspath(sys.argv[1])
ci_path = os.path.abspath(sys.argv[2])
def copy_files(src_dir, target_dir, extension):
files = glob.iglob(os.path.join(src_dir, extension))
for src in files:
if os.path.isfile(src):
print( src + ' => ' + target_dir )
... | true | true |
1c3ba6a84ec6f5569244fd31ac44b46e8d472e9d | 5,358 | py | Python | server/openslides/core/apps.py | danilobuerger/OpenSlides | 97950d5baa0e22027ea5c1f59a452f831c197cd2 | [
"MIT"
] | null | null | null | server/openslides/core/apps.py | danilobuerger/OpenSlides | 97950d5baa0e22027ea5c1f59a452f831c197cd2 | [
"MIT"
] | 2 | 2021-11-02T15:53:58.000Z | 2022-03-02T12:19:49.000Z | server/openslides/core/apps.py | danilobuerger/OpenSlides | 97950d5baa0e22027ea5c1f59a452f831c197cd2 | [
"MIT"
] | null | null | null | import sys
from typing import Any, Dict
from django.apps import AppConfig
from django.conf import settings
from django.db.models.signals import post_migrate, pre_delete
from openslides.utils import logging
from openslides.utils.schema_version import schema_version_handler
class CoreAppConfig(AppConfig):
name = ... | 32.871166 | 87 | 0.636991 | import sys
from typing import Any, Dict
from django.apps import AppConfig
from django.conf import settings
from django.db.models.signals import post_migrate, pre_delete
from openslides.utils import logging
from openslides.utils.schema_version import schema_version_handler
class CoreAppConfig(AppConfig):
name = ... | true | true |
1c3ba6e4bbe2444723334607b77450a25f2d8124 | 3,343 | py | Python | nizkctf/subrepo.py | MrMugiwara/2018 | 675a26bea30f67898d6ce00de5206476cb3d4146 | [
"MIT"
] | 1 | 2021-07-07T15:12:16.000Z | 2021-07-07T15:12:16.000Z | nizkctf/subrepo.py | MrMugiwara/2018 | 675a26bea30f67898d6ce00de5206476cb3d4146 | [
"MIT"
] | null | null | null | nizkctf/subrepo.py | MrMugiwara/2018 | 675a26bea30f67898d6ce00de5206476cb3d4146 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals, division, print_function,\
absolute_import
import os
import subprocess
import base64
import pysodium
from .settings import Settings
from .localsettings import LocalSettings
from .repohost import RepoHost
SUBREPO_NAME = 'submiss... | 31.242991 | 79 | 0.584505 |
from __future__ import unicode_literals, division, print_function,\
absolute_import
import os
import subprocess
import base64
import pysodium
from .settings import Settings
from .localsettings import LocalSettings
from .repohost import RepoHost
SUBREPO_NAME = 'submissions'
class SubRepo(obj... | true | true |
1c3ba750dca70b3fc9c0e5f11c889842c4731140 | 829 | py | Python | design_pattern/abstract_factory.py | ischaojie/learn-py | b24ec70c776fbc7176bdffbbd1b9ce46e6a25916 | [
"MIT"
] | null | null | null | design_pattern/abstract_factory.py | ischaojie/learn-py | b24ec70c776fbc7176bdffbbd1b9ce46e6a25916 | [
"MIT"
] | null | null | null | design_pattern/abstract_factory.py | ischaojie/learn-py | b24ec70c776fbc7176bdffbbd1b9ce46e6a25916 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
抽象工厂模式
将组件的实现通过一个工厂暴露出来,从而统一行为。
"""
from typing import Type
class Pet:
"""
宠物类
"""
def __init__(self, name: str):
self.name = name
def speak(self):
raise NotImplementedError
def __str__(self):
return self.name
class Dog(Pet):
def sp... | 15.351852 | 43 | 0.55006 |
from typing import Type
class Pet:
def __init__(self, name: str):
self.name = name
def speak(self):
raise NotImplementedError
def __str__(self):
return self.name
class Dog(Pet):
def speak(self):
return "woof {}".format(self.name)
class Cat(Pet):
def speak(se... | true | true |
1c3ba7ebb306911a1f12655bba992630fc3e9222 | 1,754 | py | Python | patronclient/tests/unit/v2/test_cloudpipe.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | patronclient/tests/unit/v2/test_cloudpipe.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | patronclient/tests/unit/v2/test_cloudpipe.py | casbin/openstack-patron | b41b1262f3a52c8cc9f6b6bdf87be5a1abcf6d25 | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 38.130435 | 78 | 0.68016 |
import six
from patronclient.tests.unit.fixture_data import client
from patronclient.tests.unit.fixture_data import cloudpipe as data
from patronclient.tests.unit import utils
from patronclient.v2 import cloudpipe
class CloudpipeTest(utils.FixturedTestCase):
data_fixture_class = data.Fixture
s... | true | true |
1c3ba838ed53f1489f869377b5e50e8cfdf3e5bf | 4,379 | py | Python | ipodio/database.py | sourcery-ai-bot/ipodio | e32ab2d1928a2b47500dd0ce0cbd17f71102dbe2 | [
"BSD-3-Clause"
] | 9 | 2015-06-02T23:31:20.000Z | 2021-05-17T17:26:32.000Z | ipodio/database.py | sourcery-ai-bot/ipodio | e32ab2d1928a2b47500dd0ce0cbd17f71102dbe2 | [
"BSD-3-Clause"
] | null | null | null | ipodio/database.py | sourcery-ai-bot/ipodio | e32ab2d1928a2b47500dd0ce0cbd17f71102dbe2 | [
"BSD-3-Clause"
] | 3 | 2015-10-07T21:51:38.000Z | 2021-01-23T12:22:58.000Z | #-*- coding: utf-8 -*-
"""
Database
Stores all the tracks contained within the iPod indexed in a convenient way for
fast retrieval, iteration, addition and removal.
Intended as a very thin wrapper around gpod.Database in order to provide a
cleaner interface, extra functionality and resolve some flaws.
# Create t... | 27.540881 | 79 | 0.675953 |
import gpod
from collections import defaultdict
from .track import Track
def first(iterable):
for item in iterable:
return item
class Playlist(object):
def __init__(self, playlist):
self.__playlist = playlist
@classmethod
def create(cls, name, database, internal_class=gpod.Playl... | true | true |
1c3ba95195b1da46d7bee9e066627e9b38457b92 | 10,388 | py | Python | mqtt2influxdb/mqtt2influxdb.py | tvecera/bch-mqtt2influxdb | 6e3f6b898144ce89307e61858364d005f8f6a35d | [
"MIT"
] | 15 | 2018-01-14T16:27:11.000Z | 2020-06-08T00:44:16.000Z | mqtt2influxdb/mqtt2influxdb.py | tvecera/bch-mqtt2influxdb | 6e3f6b898144ce89307e61858364d005f8f6a35d | [
"MIT"
] | 11 | 2018-05-03T07:42:34.000Z | 2020-06-24T10:01:22.000Z | mqtt2influxdb/mqtt2influxdb.py | tvecera/bch-mqtt2influxdb | 6e3f6b898144ce89307e61858364d005f8f6a35d | [
"MIT"
] | 10 | 2020-08-07T11:22:24.000Z | 2022-01-13T15:54:17.000Z | #!/usr/bin/env python3
import os
import sys
import logging
import json
from datetime import datetime
import paho.mqtt.client
from paho.mqtt.client import topic_matches_sub
import influxdb
import jsonpath_ng
import requests
import base64
from requests.auth import HTTPBasicAuth
import http.client as http_client
import b... | 45.561404 | 181 | 0.503273 |
import os
import sys
import logging
import json
from datetime import datetime
import paho.mqtt.client
from paho.mqtt.client import topic_matches_sub
import influxdb
import jsonpath_ng
import requests
import base64
from requests.auth import HTTPBasicAuth
import http.client as http_client
import builtins
import py_expr... | true | true |
1c3ba9851458fc1035a3f92f164555d9d272be19 | 1,176 | py | Python | astroplpython/data/PowerFrequencyMeasurement.py | brianthomas/astroplpython | 2bb3aad304b308a272916b3ef90db9d0fd1ce508 | [
"MIT"
] | null | null | null | astroplpython/data/PowerFrequencyMeasurement.py | brianthomas/astroplpython | 2bb3aad304b308a272916b3ef90db9d0fd1ce508 | [
"MIT"
] | null | null | null | astroplpython/data/PowerFrequencyMeasurement.py | brianthomas/astroplpython | 2bb3aad304b308a272916b3ef90db9d0fd1ce508 | [
"MIT"
] | null | null | null | '''
Created on Jul 11, 2014
@author: thomas
'''
from astroplpython.data.Measurement import x_y
import collections
class p_f(x_y):
'''
An individual measurement of Power P at frequency f; P(f)
'''
@property
def power(self):
return self.x
@property
def frequency (self):
... | 24.5 | 89 | 0.570578 | from astroplpython.data.Measurement import x_y
import collections
class p_f(x_y):
@property
def power(self):
return self.x
@property
def frequency (self):
return self.y
def __str__(self):
return "p_f(p:" + str(self.power) + " f:" + str(self.frequency) + ")"
... | true | true |
1c3baa64987a25ea8f652af70763f9e0759be4f3 | 402 | py | Python | algoexpert.io/python/Kadane's_Algorithm.py | its-sushant/coding-interview-gym | 140c19cbfe29e0941a6b6e3882d5bfdc5d36589e | [
"MIT"
] | 713 | 2019-11-19T16:11:25.000Z | 2022-03-31T02:27:52.000Z | algoexpert.io/python/Kadane's_Algorithm.py | arunsank/coding-interview-gym | 8131e3a82795707e144fe55d765b6c15bdb97306 | [
"MIT"
] | 7 | 2020-01-16T17:07:18.000Z | 2021-11-15T18:24:39.000Z | algoexpert.io/python/Kadane's_Algorithm.py | arunsank/coding-interview-gym | 8131e3a82795707e144fe55d765b6c15bdb97306 | [
"MIT"
] | 393 | 2019-11-18T17:55:45.000Z | 2022-03-28T20:26:32.000Z | # https://www.algoexpert.io/questions/Kadane's%20Algorithm
# O(n) time | O(1) space - where n is the length of the input array
def kadanesAlgorithm(array):
maxEdingHere, maxSoFar = array[0], array[0]
for i in range(1, len(array)):
num = array[i]
maxEdingAtPrevIdx = maxEdingHere
maxEdingHere = max(num, nu... | 28.714286 | 69 | 0.718905 |
# O(n) time | O(1) space - where n is the length of the input array
def kadanesAlgorithm(array):
maxEdingHere, maxSoFar = array[0], array[0]
for i in range(1, len(array)):
num = array[i]
maxEdingAtPrevIdx = maxEdingHere
maxEdingHere = max(num, num + maxEdingAtPrevIdx)
maxSoFar = max(maxSoFar, maxEding... | false | true |
1c3baaba6660298a8f8cc9c03fba5f4c5a2d7874 | 2,084 | py | Python | Codes/Mathematical/random_number_generator.py | datta-agni/Python-Codes | 4c887a81f06da4732762e35ca6c2bb34bf1d7d41 | [
"MIT"
] | null | null | null | Codes/Mathematical/random_number_generator.py | datta-agni/Python-Codes | 4c887a81f06da4732762e35ca6c2bb34bf1d7d41 | [
"MIT"
] | null | null | null | Codes/Mathematical/random_number_generator.py | datta-agni/Python-Codes | 4c887a81f06da4732762e35ca6c2bb34bf1d7d41 | [
"MIT"
] | null | null | null | # Program to generate a random number between 0 and 9
# importing the random module
import random
def randomization_generators(
low=int(input("Enter the starting point of generation: ")),
high=int(input("Enter the end point for the generation: ")),
mean=int(
input(
"Enter the mean for ... | 36.561404 | 246 | 0.662188 |
import random
def randomization_generators(
low=int(input("Enter the starting point of generation: ")),
high=int(input("Enter the end point for the generation: ")),
mean=int(
input(
"Enter the mean for generating random numbers from a probability distribution: "
)
),
... | true | true |
1c3bab1eca9dc99992fd701b30452ebb318e68c1 | 20,440 | py | Python | pyathena/classic/rst_handler.py | changgoo/pyathena-1 | c461ac3390d773537ce52393e3ebf68a3282aa46 | [
"MIT"
] | 1 | 2019-10-03T13:59:14.000Z | 2019-10-03T13:59:14.000Z | pyathena/classic/rst_handler.py | changgoo/pyathena-1 | c461ac3390d773537ce52393e3ebf68a3282aa46 | [
"MIT"
] | 3 | 2020-09-23T23:36:17.000Z | 2022-01-11T06:16:56.000Z | pyathena/classic/rst_handler.py | changgoo/pyathena-1 | c461ac3390d773537ce52393e3ebf68a3282aa46 | [
"MIT"
] | 2 | 2019-06-10T04:26:16.000Z | 2019-12-04T22:27:02.000Z | import struct
import numpy as np
import glob
import os
import sys
#writer
def parse_misc_info(rstfile):
fp=open(rstfile,'rb')
search_block=['par','time','data','star','user']
start={}
size={}
start['par']=0
iblock=0
while 1:
block=search_block[iblock]
size[block]=fp.tell(... | 30.598802 | 92 | 0.509883 | import struct
import numpy as np
import glob
import os
import sys
def parse_misc_info(rstfile):
fp=open(rstfile,'rb')
search_block=['par','time','data','star','user']
start={}
size={}
start['par']=0
iblock=0
while 1:
block=search_block[iblock]
size[block]=fp.tell()-start[... | true | true |
1c3bab33a17d606bd8b00a0e94074be567b1c6ca | 2,300 | py | Python | render/deleters.py | VCL3D/BlenderScripts | d9671801d2a7686226c9fcf297d89a4388158733 | [
"MIT"
] | 11 | 2021-05-11T17:26:59.000Z | 2022-03-25T08:13:59.000Z | render/deleters.py | VCL3D/BlenderScripts | d9671801d2a7686226c9fcf297d89a4388158733 | [
"MIT"
] | null | null | null | render/deleters.py | VCL3D/BlenderScripts | d9671801d2a7686226c9fcf297d89a4388158733 | [
"MIT"
] | 2 | 2021-05-15T01:56:01.000Z | 2021-05-15T13:49:57.000Z | import bpy
import os
def delete_cameras_lights():
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_by_type(type='CAMERA')
bpy.ops.object.delete(use_global=False)
# bpy.ops.object.select_by_type(type='LAMP')
bpy.ops.object.select_by_type(type='LIGHT')
bpy.ops.object.delete(use_globa... | 36.507937 | 105 | 0.691304 | import bpy
import os
def delete_cameras_lights():
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_by_type(type='CAMERA')
bpy.ops.object.delete(use_global=False)
bpy.ops.object.select_by_type(type='LIGHT')
bpy.ops.object.delete(use_global=False)
bpy.ops.object.select_by_type(t... | true | true |
1c3bac77eb0f911fbab4afc2653d0aed9119694d | 10,143 | py | Python | client/intelligent_collab/icollab.py | Rajpratik71/stacks-usecase | 19272c2d7f9ece306024b4bc9c97a0f9354c5f89 | [
"Apache-2.0"
] | 15 | 2019-09-19T09:32:11.000Z | 2021-03-25T15:45:11.000Z | client/intelligent_collab/icollab.py | Rajpratik71/stacks-usecase | 19272c2d7f9ece306024b4bc9c97a0f9354c5f89 | [
"Apache-2.0"
] | 8 | 2019-11-01T12:13:15.000Z | 2020-04-06T19:18:13.000Z | client/intelligent_collab/icollab.py | Rajpratik71/stacks-usecase | 19272c2d7f9ece306024b4bc9c97a0f9354c5f89 | [
"Apache-2.0"
] | 21 | 2019-09-19T16:57:41.000Z | 2021-09-23T04:57:25.000Z | #!/usr/bin/python3
"""Runner for Intelligent Collaboration App"""
import sys
import subprocess
import json
import requests
import re
import time
import yaml
import os
import tarfile
import shutil
import threading
MODELS_DIR = os.environ.get("MODELS_DIR", "./saved_models")
# Format for models lists is [(file_url, di... | 34.5 | 95 | 0.618062 |
import sys
import subprocess
import json
import requests
import re
import time
import yaml
import os
import tarfile
import shutil
import threading
MODELS_DIR = os.environ.get("MODELS_DIR", "./saved_models")
TAR_MODELS = [("https://tfhub.dev/tensorflow/ssd_mobilenet_v2/2\
?tf-hub-format=compressed", "ssd_mobilenet... | true | true |
1c3bacb5a940d60298ac8eeb273dc21d6fefc628 | 9,048 | py | Python | scalability/generate_report.py | zhiiker/ic | 370af58ea1231cdbb8d2e4f593a089dfd1c803cd | [
"Apache-2.0"
] | 941 | 2021-05-10T08:14:14.000Z | 2022-03-31T11:40:24.000Z | scalability/generate_report.py | zhiiker/ic | 370af58ea1231cdbb8d2e4f593a089dfd1c803cd | [
"Apache-2.0"
] | 3 | 2022-02-16T12:24:20.000Z | 2022-03-23T12:05:41.000Z | scalability/generate_report.py | zhiiker/ic | 370af58ea1231cdbb8d2e4f593a089dfd1c803cd | [
"Apache-2.0"
] | 122 | 2021-05-10T08:21:23.000Z | 2022-03-25T20:34:12.000Z | #!/usr/bin/env python3
import json
import os
import sys
import pybars
import report
def add_file(base, path, alt):
content = ""
try:
for p in path:
content += open(os.path.join(base, p)).read()
except Exception:
content += alt
return content
def generate_report(githash,... | 41.695853 | 133 | 0.461649 |
import json
import os
import sys
import pybars
import report
def add_file(base, path, alt):
content = ""
try:
for p in path:
content += open(os.path.join(base, p)).read()
except Exception:
content += alt
return content
def generate_report(githash, timestamp):
sourc... | true | true |
1c3bae3498469302a5a347b215e67a7b1cc21b18 | 87 | py | Python | makahiki/apps/widgets/ask_admin/__init__.py | justinslee/Wai-Not-Makahiki | 4b7dd685012ec64758affe0ecee3103596d16aa7 | [
"MIT"
] | 1 | 2015-07-22T11:31:20.000Z | 2015-07-22T11:31:20.000Z | makahiki/apps/widgets/ask_admin/__init__.py | justinslee/Wai-Not-Makahiki | 4b7dd685012ec64758affe0ecee3103596d16aa7 | [
"MIT"
] | null | null | null | makahiki/apps/widgets/ask_admin/__init__.py | justinslee/Wai-Not-Makahiki | 4b7dd685012ec64758affe0ecee3103596d16aa7 | [
"MIT"
] | null | null | null | """The ask_admin widget implements a "send feedback" button and corresponding form."""
| 43.5 | 86 | 0.770115 | true | true | |
1c3baf888f5130998962f4ec6d561434293266db | 9,714 | py | Python | archive/scripts/STIPS_Input_from_Sims/wingtips.py | benw1/WINGS | 32d4bfd073da0b86d2340cde25a5601d0a1ec95e | [
"RSA-MD"
] | 4 | 2022-01-04T18:24:56.000Z | 2022-01-27T08:23:37.000Z | scratch/test_phat/wingtips.py | benw1/WINGS | 32d4bfd073da0b86d2340cde25a5601d0a1ec95e | [
"RSA-MD"
] | null | null | null | scratch/test_phat/wingtips.py | benw1/WINGS | 32d4bfd073da0b86d2340cde25a5601d0a1ec95e | [
"RSA-MD"
] | null | null | null | #! /usr/bin/env python
'''
WFIRST Infrared Nearby Galaxies Test Image Product Simulator
Produces input files for the WFIRST STIPS simulator
'''
import time
import numpy as np
from astropy import wcs
from astropy.io import fits, ascii
from astropy.table import Table
class WingTips:
'''
Initialize WingTips objec... | 34.692857 | 122 | 0.561149 |
import time
import numpy as np
from astropy import wcs
from astropy.io import fits, ascii
from astropy.table import Table
class WingTips:
def __init__(self,infile=[],center=[0,0]):
if len(infile)==0:
self.tab = np.array([])
else:
if isinstance(infile,str):
i... | true | true |
1c3baff9ee3dae881980efce46596d20205c6346 | 7,181 | py | Python | nn-basics/mlp.py | frgfm/udacity-dl-exercises | 200c63bbfd6949557c8f410b0f2f52bd1ae245b4 | [
"MIT"
] | 10 | 2018-12-09T23:54:25.000Z | 2018-12-30T20:01:00.000Z | nn-basics/mlp.py | frgfm/udacity-dl-exercises | 200c63bbfd6949557c8f410b0f2f52bd1ae245b4 | [
"MIT"
] | null | null | null | nn-basics/mlp.py | frgfm/udacity-dl-exercises | 200c63bbfd6949557c8f410b0f2f52bd1ae245b4 | [
"MIT"
] | 7 | 2018-12-09T22:16:26.000Z | 2019-01-08T07:05:12.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Building blocks of Artificial neural network
'''
__author__ = 'François-Guillaume Fernandez'
__license__ = 'MIT License'
__version__ = '0.1'
__maintainer__ = 'François-Guillaume Fernandez'
__status__ = 'Development'
import numpy as np
class Activation:
def __... | 40.570621 | 148 | 0.643086 |
'''
Building blocks of Artificial neural network
'''
__author__ = 'François-Guillaume Fernandez'
__license__ = 'MIT License'
__version__ = '0.1'
__maintainer__ = 'François-Guillaume Fernandez'
__status__ = 'Development'
import numpy as np
class Activation:
def __init__(self, function, derivative):
... | false | true |
1c3bb0e2e1d90d4d7e41b9417c279b9e455b1708 | 30,144 | py | Python | python-sc2/sc2/units.py | manaccac/sc2_bot | 3aa8b3711378b71fd0a44662cdd7148846e39530 | [
"MIT"
] | 9 | 2020-04-28T12:12:23.000Z | 2022-03-14T03:45:45.000Z | python-sc2/sc2/units.py | manaccac/sc2_bot | 3aa8b3711378b71fd0a44662cdd7148846e39530 | [
"MIT"
] | 5 | 2021-03-30T05:10:49.000Z | 2022-01-13T04:32:05.000Z | python-sc2/sc2/units.py | manaccac/sc2_bot | 3aa8b3711378b71fd0a44662cdd7148846e39530 | [
"MIT"
] | 4 | 2020-04-28T12:14:58.000Z | 2022-02-22T07:15:28.000Z | from __future__ import annotations
import random
import warnings
import math
from itertools import chain
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union, Generator, TYPE_CHECKING
from .ids.unit_typeid import UnitTypeId
from .position import Point2, Point3
from .unit import Unit
import numpy a... | 41.236662 | 211 | 0.640293 | from __future__ import annotations
import random
import warnings
import math
from itertools import chain
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union, Generator, TYPE_CHECKING
from .ids.unit_typeid import UnitTypeId
from .position import Point2, Point3
from .unit import Unit
import numpy a... | true | true |
1c3bb115a47bdc77dc8dabb9c45848ab2475a739 | 4,164 | py | Python | openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_om/Opengauss_Function_Tools_gs_om_Case0021.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_om/Opengauss_Function_Tools_gs_om_Case0021.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_om/Opengauss_Function_Tools_gs_om_Case0021.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 35.896552 | 84 | 0.632565 |
import os
import unittest
from yat.test import Node
from yat.test import macro
from testcase.utils.Constant import Constant
from testcase.utils.Logger import Logger
from testcase.utils.CommonSH import CommonSH
class Tools(unittest.TestCase):
def setUp(self):
self.log = Logger()
self.log.info('---... | true | true |
1c3bb29f89d89209a3b9f7d405e87b11f19a59db | 16,143 | py | Python | annotation/typed.py | raabf/typeannotations | 7a3bffbb3b7e690b6f064f70a586820e3a741c5f | [
"Apache-2.0"
] | 84 | 2015-01-15T13:25:21.000Z | 2021-09-29T08:02:32.000Z | annotation/typed.py | raabf/typeannotations | 7a3bffbb3b7e690b6f064f70a586820e3a741c5f | [
"Apache-2.0"
] | 4 | 2015-04-05T18:16:37.000Z | 2017-02-11T11:59:43.000Z | annotation/typed.py | raabf/typeannotations | 7a3bffbb3b7e690b6f064f70a586820e3a741c5f | [
"Apache-2.0"
] | 4 | 2015-02-12T04:21:07.000Z | 2019-07-30T16:54:01.000Z | # Written by Manuel Cerón
# Copyright Manuel Cerón. 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 b... | 31.966337 | 103 | 0.634702 |
__author__ = ('Manuel Cerón <ceronman@gmail.com>')
__all__ = ['AnyType', 'Interface', 'only', 'optional', 'options', 'predicate',
'typechecked', 'typedef', 'union']
import functools
import inspect
EMPTY_ANNOTATION = inspect.Signature.empty
class UnionMeta(type):
def __new__(mcls, nam... | true | true |
1c3bb400a73babd821204f687e96422e40b4cfe7 | 6,137 | py | Python | tests/test_api.py | FollowTheProcess/pytoil | b13acb14f015ae5399d7697bdc3e0e475dff03ec | [
"Apache-2.0"
] | 6 | 2021-05-08T20:31:03.000Z | 2022-03-08T01:25:43.000Z | tests/test_api.py | FollowTheProcess/pytoil | b13acb14f015ae5399d7697bdc3e0e475dff03ec | [
"Apache-2.0"
] | 116 | 2021-07-08T11:21:22.000Z | 2022-03-30T14:04:51.000Z | tests/test_api.py | FollowTheProcess/pytoil | b13acb14f015ae5399d7697bdc3e0e475dff03ec | [
"Apache-2.0"
] | null | null | null | """
Tests for the API module.
Author: Tom Fleet
Created: 19/06/2021
"""
import httpx
import pytest
from pytest_httpx import HTTPXMock
from pytoil.api import API
from pytoil.api.models import Repository, RepoSummaryInfo
def test_api_init():
api = API(username="me", token="sometoken")
assert api.username =... | 26.226496 | 88 | 0.675411 |
import httpx
import pytest
from pytest_httpx import HTTPXMock
from pytoil.api import API
from pytoil.api.models import Repository, RepoSummaryInfo
def test_api_init():
api = API(username="me", token="sometoken")
assert api.username == "me"
assert api.token == "sometoken"
assert api.baseurl == "htt... | true | true |
1c3bb4a8700b7b6ceeb2282618fdb0a9777458d7 | 7,392 | py | Python | util/esum_cxx.py | yut23/Microphysics | 3c4985213c5e5b1ad2602b0bba2ce164b847361a | [
"BSD-3-Clause"
] | 16 | 2017-08-17T11:12:01.000Z | 2021-06-10T23:11:08.000Z | util/esum_cxx.py | Youhichka/Microphysics | 6f28333d40c9e15fdfbb1c4dc208e887fb5549c3 | [
"BSD-3-Clause"
] | 533 | 2017-06-08T13:52:11.000Z | 2022-01-28T16:13:29.000Z | util/esum_cxx.py | Youhichka/Microphysics | 6f28333d40c9e15fdfbb1c4dc208e887fb5549c3 | [
"BSD-3-Clause"
] | 34 | 2017-08-16T16:29:20.000Z | 2021-09-09T16:19:15.000Z | import os
import re
import argparse
module_start = """
// NOTE: THIS FILE IS AUTOMATICALLY GENERATED
// DO NOT EDIT BY HAND
// Re-run esum_cxx.py to update this file
// Fortran 2003 implementation of the msum routine
// provided by Raymond Hettinger:
// https://code.activestate.com/recipes/393090/
// This routine ... | 24.805369 | 113 | 0.552489 | import os
import re
import argparse
module_start = """
// NOTE: THIS FILE IS AUTOMATICALLY GENERATED
// DO NOT EDIT BY HAND
// Re-run esum_cxx.py to update this file
// Fortran 2003 implementation of the msum routine
// provided by Raymond Hettinger:
// https://code.activestate.com/recipes/393090/
// This routine ... | true | true |
1c3bb4c51056c6275e8d40ff8c2a85830d4c3984 | 8,686 | py | Python | tools/xctoolrunner/xctoolrunner.py | michaeleisel/rules_apple | 424c73847eba4d2a093fa59df1aa22b5629b0fda | [
"Apache-2.0"
] | null | null | null | tools/xctoolrunner/xctoolrunner.py | michaeleisel/rules_apple | 424c73847eba4d2a093fa59df1aa22b5629b0fda | [
"Apache-2.0"
] | null | null | null | tools/xctoolrunner/xctoolrunner.py | michaeleisel/rules_apple | 424c73847eba4d2a093fa59df1aa22b5629b0fda | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2018 The Bazel 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
#
# Unle... | 28.019355 | 80 | 0.677872 |
import argparse
import os
import re
import sys
from build_bazel_rules_apple.tools.wrapper_common import execute
_PATH_PREFIX = "[ABSOLUTE]"
_PATH_PREFIX_LEN = len(_PATH_PREFIX)
def _apply_realpath(argv):
for i, arg in enumerate(argv):
if arg.startswith(_PATH_PREFIX):
arg = arg[_PATH_PR... | true | true |
1c3bb5d7b8ef35ba870c07dc260cf6862e87d7c9 | 544 | py | Python | backend/todo/migrations/0006_auto_20190403_0603.py | Bhunesh2000/todoWithDjango | e5fa52a087180b66ae283e6b36fe790323d7b920 | [
"MIT"
] | null | null | null | backend/todo/migrations/0006_auto_20190403_0603.py | Bhunesh2000/todoWithDjango | e5fa52a087180b66ae283e6b36fe790323d7b920 | [
"MIT"
] | 11 | 2019-04-03T09:49:17.000Z | 2022-02-10T08:23:26.000Z | backend/todo/migrations/0006_auto_20190403_0603.py | Bhunesh2000/todoWithDjango | e5fa52a087180b66ae283e6b36fe790323d7b920 | [
"MIT"
] | 1 | 2019-10-21T19:26:29.000Z | 2019-10-21T19:26:29.000Z | # Generated by Django 2.2 on 2019-04-03 06:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('todo', '0005_auto_20190403_0445'),
]
operations = [
migrations.AddField(
model_name='todo',
name='completed',
... | 22.666667 | 64 | 0.573529 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('todo', '0005_auto_20190403_0445'),
]
operations = [
migrations.AddField(
model_name='todo',
name='completed',
field=models.BooleanField(default=False, ... | true | true |
1c3bb5ef3ecbbd63192d2619e582be5c16041aec | 569 | py | Python | asgi_tortoise_orm/middleware.py | erm/asgi-tortoise-orm | 6f192c6418d6f0d7144e7fd7c2f01f0498ff4020 | [
"MIT"
] | 1 | 2019-05-27T08:51:18.000Z | 2019-05-27T08:51:18.000Z | asgi_tortoise_orm/middleware.py | erm/asgi-tortoise-orm | 6f192c6418d6f0d7144e7fd7c2f01f0498ff4020 | [
"MIT"
] | null | null | null | asgi_tortoise_orm/middleware.py | erm/asgi-tortoise-orm | 6f192c6418d6f0d7144e7fd7c2f01f0498ff4020 | [
"MIT"
] | 1 | 2018-11-14T10:15:42.000Z | 2018-11-14T10:15:42.000Z | from tortoise import Tortoise
class TortoiseMiddleware:
def __init__(self, app):
self.app = app
def __call__(self, scope):
return _TortoiseResponder(self.app, scope)
class _TortoiseResponder:
def __init__(self, app, scope):
self.app = app
self.scope = scope
async de... | 23.708333 | 56 | 0.615114 | from tortoise import Tortoise
class TortoiseMiddleware:
def __init__(self, app):
self.app = app
def __call__(self, scope):
return _TortoiseResponder(self.app, scope)
class _TortoiseResponder:
def __init__(self, app, scope):
self.app = app
self.scope = scope
async de... | true | true |
1c3bb64903af96d443a57b5692c22d59027102c2 | 2,892 | py | Python | tests/unit/modules/test_win_certutil.py | nevins-b/salt | 56363bc41ca36e757103df3504d1bb07e3a7251b | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/test_win_certutil.py | nevins-b/salt | 56363bc41ca36e757103df3504d1bb07e3a7251b | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/test_win_certutil.py | nevins-b/salt | 56363bc41ca36e757103df3504d1bb07e3a7251b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Libs
import salt.modules.win_certutil as certutil
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
from tests.support.mock import (
MagicMock,... | 41.314286 | 103 | 0.649032 |
from __future__ import absolute_import
import salt.modules.win_certutil as certutil
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
from tests.support.mock import (
MagicMock,
patch
)
class CertUtilTestCase(TestCase, LoaderModuleMockMixin):
def setup_... | true | true |
1c3bb65200aaa36dc133fe48545071a401c25379 | 13,259 | py | Python | ORIGINAL/discord/ext/tasks/__init__.py | DiEVeXx/discord.py | 812e5eb5ee611689dab272534a5c65d0102e5957 | [
"MIT"
] | null | null | null | ORIGINAL/discord/ext/tasks/__init__.py | DiEVeXx/discord.py | 812e5eb5ee611689dab272534a5c65d0102e5957 | [
"MIT"
] | null | null | null | ORIGINAL/discord/ext/tasks/__init__.py | DiEVeXx/discord.py | 812e5eb5ee611689dab272534a5c65d0102e5957 | [
"MIT"
] | null | null | null | import asyncio
import datetime
import aiohttp
import websockets
from ORIGINAL import discord
import inspect
import logging
from ORIGINAL.discord.backoff import ExponentialBackoff
log = logging.getLogger(__name__)
class Loop:
"""A background task helper that abstracts the loop and reconnection logic for you.
... | 32.900744 | 112 | 0.598386 | import asyncio
import datetime
import aiohttp
import websockets
from ORIGINAL import discord
import inspect
import logging
from ORIGINAL.discord.backoff import ExponentialBackoff
log = logging.getLogger(__name__)
class Loop:
def __init__(self, coro, seconds, hours, minutes, count, reconnect, loop):
self.... | true | true |
1c3bb731700e025c1b8f1ddb272dc096b4d17c18 | 4,309 | py | Python | mlflow/store/gcs_artifact_repo.py | 0wu/mlflow | 2b5a21af05defcfa80255c081b5d9f07443f3f64 | [
"Apache-2.0"
] | null | null | null | mlflow/store/gcs_artifact_repo.py | 0wu/mlflow | 2b5a21af05defcfa80255c081b5d9f07443f3f64 | [
"Apache-2.0"
] | null | null | null | mlflow/store/gcs_artifact_repo.py | 0wu/mlflow | 2b5a21af05defcfa80255c081b5d9f07443f3f64 | [
"Apache-2.0"
] | null | null | null | import os
from six.moves import urllib
from mlflow.entities.file_info import FileInfo
from mlflow.store.artifact_repo import ArtifactRepository
from mlflow.utils.file_utils import build_path, get_relative_path, TempDir
class GCSArtifactRepository(ArtifactRepository):
"""
Stores artifacts on Google Cloud Sto... | 39.53211 | 94 | 0.660246 | import os
from six.moves import urllib
from mlflow.entities.file_info import FileInfo
from mlflow.store.artifact_repo import ArtifactRepository
from mlflow.utils.file_utils import build_path, get_relative_path, TempDir
class GCSArtifactRepository(ArtifactRepository):
def __init__(self, artifact_uri, client=Non... | true | true |
1c3bb868be6fb7c76207db8e6603eead6f143d93 | 221 | py | Python | Exercise 028.py | sayan-datapython/Learn_Python_Full_Course_for_Beginners | 1cca3df62cfd7ae5a0c85c019b0f5fe4f6f4740c | [
"MIT"
] | null | null | null | Exercise 028.py | sayan-datapython/Learn_Python_Full_Course_for_Beginners | 1cca3df62cfd7ae5a0c85c019b0f5fe4f6f4740c | [
"MIT"
] | null | null | null | Exercise 028.py | sayan-datapython/Learn_Python_Full_Course_for_Beginners | 1cca3df62cfd7ae5a0c85c019b0f5fe4f6f4740c | [
"MIT"
] | 1 | 2020-09-30T14:25:51.000Z | 2020-09-30T14:25:51.000Z | import random
player = int(input('Enter any number between 1 to 5: '))
if player == random.randint(0,5):
print('Your Win, right number {}'.format(player))
else:
print('Not the number, PC win {}'.format(player))
| 24.555556 | 56 | 0.665158 | import random
player = int(input('Enter any number between 1 to 5: '))
if player == random.randint(0,5):
print('Your Win, right number {}'.format(player))
else:
print('Not the number, PC win {}'.format(player))
| true | true |
1c3bb8b1126991851c910af743a18b80a02fa8ec | 6,986 | py | Python | MAMchem_GridComp/optics/gads.py | GEOS-ESM/GEOSchem_GridComp | d5a0f1309c56000491606857161930d155fb4544 | [
"NASA-1.3",
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-02-01T17:37:05.000Z | 2020-02-01T17:37:05.000Z | MAMchem_GridComp/optics/gads.py | GEOS-ESM/GEOSchem_GridComp | d5a0f1309c56000491606857161930d155fb4544 | [
"NASA-1.3",
"ECL-2.0",
"Apache-2.0"
] | 91 | 2019-07-31T12:57:44.000Z | 2022-03-18T14:49:54.000Z | MAMchem_GridComp/optics/gads.py | GEOS-ESM/GEOSchem_GridComp | d5a0f1309c56000491606857161930d155fb4544 | [
"NASA-1.3",
"ECL-2.0",
"Apache-2.0"
] | 5 | 2019-12-23T15:56:05.000Z | 2021-08-25T14:08:54.000Z | #!/usr/bin/env python
import os
import numpy as np
import scipy.interpolate
class GADS:
def __init__(self, file):
self.file = file
self.parse_optical_parameters()
def parse_optical_parameters(self):
_optical_parameters = []
with open(self.file) as f:
... | 32.193548 | 134 | 0.541225 |
import os
import numpy as np
import scipy.interpolate
class GADS:
def __init__(self, file):
self.file = file
self.parse_optical_parameters()
def parse_optical_parameters(self):
_optical_parameters = []
with open(self.file) as f:
for line in f:
... | false | true |
1c3bb8db1a9efd72cb6495569f020bdb0f2f5985 | 1,358 | py | Python | dolphin/task_manager/resources.py | ThisIsClark/dolphin | 204cffd3faa1c83fde90942537737fe441406cd1 | [
"Apache-2.0"
] | null | null | null | dolphin/task_manager/resources.py | ThisIsClark/dolphin | 204cffd3faa1c83fde90942537737fe441406cd1 | [
"Apache-2.0"
] | null | null | null | dolphin/task_manager/resources.py | ThisIsClark/dolphin | 204cffd3faa1c83fde90942537737fe441406cd1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The SODA Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 27.16 | 74 | 0.669367 |
from oslo_log import log
LOG = log.getLogger(__name__)
class StoragePoolTask:
def __init__(self, context, storage_id):
self.storage_id = storage_id
self.context = context
def sync(self):
LOG.info('Pool sync func...')
pass
def remo... | true | true |
1c3bb9b1864c1ec80b70dee70f1b782a1a0c9ca5 | 397 | py | Python | packages/grid/backend/grid/core/celery_config.py | leosole/PySyft | 01606f08f5ec5510840644e198301cd25c3ccfa5 | [
"Apache-1.1"
] | null | null | null | packages/grid/backend/grid/core/celery_config.py | leosole/PySyft | 01606f08f5ec5510840644e198301cd25c3ccfa5 | [
"Apache-1.1"
] | null | null | null | packages/grid/backend/grid/core/celery_config.py | leosole/PySyft | 01606f08f5ec5510840644e198301cd25c3ccfa5 | [
"Apache-1.1"
] | null | null | null | worker_send_task_event = False
task_ignore_result = True
task_time_limit = 600 # Rasswanth: should modify after optimizing PC
task_acks_late = True
broker_pool_limit = 500
worker_prefetch_multiplier = 1
task_routes = {
"grid.worker.msg_without_reply": "main-queue",
"delivery_mode": "transient",
}
accept_conten... | 28.357143 | 69 | 0.775819 | worker_send_task_event = False
task_ignore_result = True
task_time_limit = 600
task_acks_late = True
broker_pool_limit = 500
worker_prefetch_multiplier = 1
task_routes = {
"grid.worker.msg_without_reply": "main-queue",
"delivery_mode": "transient",
}
accept_content = ["application/syft"]
task_serializer = "sy... | true | true |
1c3bb9f80d17be7bc27d33f99a830fdbfd84454a | 3,921 | py | Python | equivalence/tables/node.py | Shurik412/equivalence_rastr_win3 | c37119f9cc59dcf96d236cd8f3ec090dc65a5db6 | [
"MIT"
] | null | null | null | equivalence/tables/node.py | Shurik412/equivalence_rastr_win3 | c37119f9cc59dcf96d236cd8f3ec090dc65a5db6 | [
"MIT"
] | null | null | null | equivalence/tables/node.py | Shurik412/equivalence_rastr_win3 | c37119f9cc59dcf96d236cd8f3ec090dc65a5db6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Модуль переменных таблицы узлов RastrWin3
from dataclasses import dataclass
@dataclass(frozen=True)
class Node:
"""
Параметры таблицы узлов
"""
table: str = 'node'
table_name: str = '"Узлы"'
sel: str = 'sel' # отметка узла
sta: str = 'sta' # S, состояние узла
... | 44.05618 | 115 | 0.644223 |
from dataclasses import dataclass
@dataclass(frozen=True)
class Node:
table: str = 'node'
table_name: str = '"Узлы"'
sel: str = 'sel'
sta: str = 'sta'
tip: str = 'tip'
ny: str = 'ny'
name: str = 'name'
nsx: str = 'nsx'
na: str = 'na'
npa: str = 'npa'
sta_... | true | true |
1c3bba37f01fac3d2024abcc3b5f5d44e94bdb92 | 370 | py | Python | tests/config.py | balexander85/tweet_capture | 81caf672c4ac47de84f0aa2ce5a8d89b69e5349c | [
"MIT"
] | null | null | null | tests/config.py | balexander85/tweet_capture | 81caf672c4ac47de84f0aa2ce5a8d89b69e5349c | [
"MIT"
] | 2 | 2022-02-14T23:56:05.000Z | 2022-02-23T02:10:48.000Z | tests/config.py | balexander85/tweet_capture | 81caf672c4ac47de84f0aa2ce5a8d89b69e5349c | [
"MIT"
] | null | null | null | """config.py
Module containing the paths for chromedriver and conf directory
"""
from configparser import ConfigParser
from pathlib import Path
BASE_DIR = Path.cwd()
CONFIG_PATH = str(BASE_DIR.joinpath("tests", "conf", "config.ini"))
config = ConfigParser()
config.read(CONFIG_PATH)
# Selenium config
CHROME_DRIVER_P... | 23.125 | 67 | 0.772973 | from configparser import ConfigParser
from pathlib import Path
BASE_DIR = Path.cwd()
CONFIG_PATH = str(BASE_DIR.joinpath("tests", "conf", "config.ini"))
config = ConfigParser()
config.read(CONFIG_PATH)
CHROME_DRIVER_PATH = config.get("default", "CHROME_DRIVER_PATH")
| true | true |
1c3bbb7ca9541a8bea721a842cf1ed28423a4111 | 9,768 | py | Python | pkgcore/test/test_plugin.py | pombreda/pkgcore | b438fc573af1a031d7ce12adbbf299bab5338451 | [
"BSD-3-Clause"
] | 1 | 2021-07-05T13:10:18.000Z | 2021-07-05T13:10:18.000Z | pkgcore/test/test_plugin.py | vapier/pkgcore | 35a7e4f4f0fc61dd9c4dc72d35a57e2e9d5b832f | [
"BSD-3-Clause"
] | 8 | 2015-03-24T14:21:44.000Z | 2015-03-24T14:21:44.000Z | pkgcore/test/test_plugin.py | vapier/pkgcore | 35a7e4f4f0fc61dd9c4dc72d35a57e2e9d5b832f | [
"BSD-3-Clause"
] | null | null | null | # Copyright: 2011 Brian Harring <ferringb@gmail.com>
# Copyright: 2006 Marien Zwart <marienz@gentoo.org>
# License: BSD/GPL2
import logging
import os
import shutil
import sys
import tempfile
from snakeoil import lists
from snakeoil.osutils import pjoin
from pkgcore import plugin
from pkgcore.test import silence_logg... | 32.778523 | 79 | 0.627662 |
import logging
import os
import shutil
import sys
import tempfile
from snakeoil import lists
from snakeoil.osutils import pjoin
from pkgcore import plugin
from pkgcore.test import silence_logging, TestCase
class LowPlug(object):
priority = 1
class ModulesTest(TestCase):
def setUp(self):
... | true | true |
1c3bbb94848eda13cf7e65df610d7865e1377e94 | 1,825 | py | Python | column_self_define.py | xiaojinchuan/flask-sqlalchemy-usage | db7f41351ca06d7007cb87ef78beaaf631ae4e21 | [
"MIT"
] | null | null | null | column_self_define.py | xiaojinchuan/flask-sqlalchemy-usage | db7f41351ca06d7007cb87ef78beaaf631ae4e21 | [
"MIT"
] | null | null | null | column_self_define.py | xiaojinchuan/flask-sqlalchemy-usage | db7f41351ca06d7007cb87ef78beaaf631ae4e21 | [
"MIT"
] | null | null | null | """
在mysql5.7中使用JSON列
为JSON列中某些内容创建虚拟列,并为此虚拟列建立索引,以方便查询
"""
from sqlalchemy.schema import CreateColumn
from sqlalchemy.ext.compiler import compiles
@compiles(CreateColumn, 'mysql')
def mysql_genereted_column(element, compiler, **kwargs):
"""
如果字段定义中含有generated_with, 将根据info中的generate方法修改创建列的过程
mysql 指此函数... | 30.932203 | 114 | 0.693151 |
from sqlalchemy.schema import CreateColumn
from sqlalchemy.ext.compiler import compiles
@compiles(CreateColumn, 'mysql')
def mysql_genereted_column(element, compiler, **kwargs):
column = element.element
if 'generated_with' not in column.info:
return compiler.visit_create_column(element, **kwargs)
... | true | true |
1c3bbbe31941967bac1f78f34bcb108e8f5aa6f8 | 237 | py | Python | tests/apps/page_parts/pages/without.py | T4rk1n/dazzler | 69c49422dc19c910445ab265b1d3481041de8f43 | [
"MIT"
] | 15 | 2019-12-19T11:57:30.000Z | 2021-11-15T23:34:41.000Z | tests/apps/page_parts/pages/without.py | T4rk1n/dazzler | 69c49422dc19c910445ab265b1d3481041de8f43 | [
"MIT"
] | 196 | 2019-09-21T15:10:14.000Z | 2022-03-31T11:07:48.000Z | tests/apps/page_parts/pages/without.py | T4rk1n/dazzler | 69c49422dc19c910445ab265b1d3481041de8f43 | [
"MIT"
] | 7 | 2019-10-30T19:38:15.000Z | 2021-12-01T04:54:16.000Z | from dazzler.components import core
from dazzler.system import Page
page = Page(
__name__,
core.Container([
core.Text('Without', identity='without'),
]),
include_app_footer=False,
include_app_header=False,
)
| 19.75 | 49 | 0.687764 | from dazzler.components import core
from dazzler.system import Page
page = Page(
__name__,
core.Container([
core.Text('Without', identity='without'),
]),
include_app_footer=False,
include_app_header=False,
)
| true | true |
1c3bbc27ea91e63e86a79cac8a61c37bf33b24ed | 17,777 | py | Python | tacker/vnfm/monitor_drivers/zabbix/zabbix.py | qubitn1nja/tacker | 5b40d877a7050cbbec6bdf8ccd77eb7cf224f1b1 | [
"Apache-2.0"
] | 1 | 2020-10-13T05:20:38.000Z | 2020-10-13T05:20:38.000Z | tacker/vnfm/monitor_drivers/zabbix/zabbix.py | qubitn1nja/tacker | 5b40d877a7050cbbec6bdf8ccd77eb7cf224f1b1 | [
"Apache-2.0"
] | null | null | null | tacker/vnfm/monitor_drivers/zabbix/zabbix.py | qubitn1nja/tacker | 5b40d877a7050cbbec6bdf8ccd77eb7cf224f1b1 | [
"Apache-2.0"
] | 1 | 2020-02-08T08:15:53.000Z | 2020-02-08T08:15:53.000Z | # All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 42.630695 | 79 | 0.504922 |
import json
import requests
import time
import copy
from oslo_log import log as logging
from tacker.vnfm.monitor_drivers import abstract_driver
from tacker.vnfm.monitor_drivers.zabbix import zabbix_api as zapi
LOG = logging.getLogger(__name__)
class VNFMonitorZabbix(abstract_driver.VNFMonitorAbstrac... | true | true |
1c3bbcdd043c8c2b39533286041bc0531e8837cb | 4,133 | py | Python | dim/display.py | Stratoscale/dim | d1cb315725ccf9003771773bcae025559d48aa20 | [
"MIT"
] | 7 | 2018-03-05T13:36:49.000Z | 2020-11-28T03:54:15.000Z | dim/display.py | Stratoscale/dim | d1cb315725ccf9003771773bcae025559d48aa20 | [
"MIT"
] | 1 | 2021-08-05T11:38:08.000Z | 2021-08-05T16:39:59.000Z | dim/display.py | Stratoscale/dim | d1cb315725ccf9003771773bcae025559d48aa20 | [
"MIT"
] | 1 | 2020-01-29T08:11:37.000Z | 2020-01-29T08:11:37.000Z | import time
import datetime
import argparse
import docker
import tabulate
import humanize
import dim.common as common
SORT_BY_TO_KEY = {
'age': lambda (image, age): age,
'image': lambda (image, age): image
}
def get_history(history, whitelist, reference_time, min_age=0, quiet=False, sort_by='age', reverse=... | 36.575221 | 118 | 0.683765 | import time
import datetime
import argparse
import docker
import tabulate
import humanize
import dim.common as common
SORT_BY_TO_KEY = {
'age': lambda (image, age): age,
'image': lambda (image, age): image
}
def get_history(history, whitelist, reference_time, min_age=0, quiet=False, sort_by='age', reverse=... | false | true |
1c3bbd283dbda4b1f40e22b50b367a2c196bb93f | 278 | py | Python | examples/advanced/convexHull.py | CommanderPho/vedo | a0784a47d1b1a92f71b81f153c12856ccf7ec242 | [
"MIT"
] | 1 | 2022-03-22T21:49:29.000Z | 2022-03-22T21:49:29.000Z | examples/advanced/convexHull.py | CommanderPho/vedo | a0784a47d1b1a92f71b81f153c12856ccf7ec242 | [
"MIT"
] | null | null | null | examples/advanced/convexHull.py | CommanderPho/vedo | a0784a47d1b1a92f71b81f153c12856ccf7ec242 | [
"MIT"
] | null | null | null | """Create the Convex Hull of a Mesh or a set of input points"""
from vedo import *
settings.defaultFont = 'Bongas'
settings.useDepthPeeling = True
spid = Mesh(dataurl+"spider.ply").c("brown")
ch = ConvexHull(spid.points()).alpha(0.2)
show(spid, ch, __doc__, axes=1).close()
| 23.166667 | 63 | 0.708633 | from vedo import *
settings.defaultFont = 'Bongas'
settings.useDepthPeeling = True
spid = Mesh(dataurl+"spider.ply").c("brown")
ch = ConvexHull(spid.points()).alpha(0.2)
show(spid, ch, __doc__, axes=1).close()
| true | true |
1c3bbf598e20b126cffd55cf727b8673e654f30c | 499 | py | Python | tests/contrib/test_uv.py | ZacheryGuan/python-pinyin | c16f4bc72ebbb4deabb31f867ec6db913a8a6327 | [
"MIT"
] | 1 | 2020-12-06T20:48:01.000Z | 2020-12-06T20:48:01.000Z | tests/contrib/test_uv.py | ZacheryGuan/python-pinyin | c16f4bc72ebbb4deabb31f867ec6db913a8a6327 | [
"MIT"
] | null | null | null | tests/contrib/test_uv.py | ZacheryGuan/python-pinyin | c16f4bc72ebbb4deabb31f867ec6db913a8a6327 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from pypinyin import lazy_pinyin
from pypinyin.contrib.uv import V2UMixin
from pypinyin.converter import DefaultConverter
from pypinyin.core import Pinyin
class MyConverter(V2UMixin, DefaultConverter):
pass
my_pinyin = Pinyin(MyConverter())
def ... | 23.761905 | 60 | 0.719439 |
from __future__ import unicode_literals
from pypinyin import lazy_pinyin
from pypinyin.contrib.uv import V2UMixin
from pypinyin.converter import DefaultConverter
from pypinyin.core import Pinyin
class MyConverter(V2UMixin, DefaultConverter):
pass
my_pinyin = Pinyin(MyConverter())
def test_v2u():
assert ... | true | true |
1c3bbf68330d376d9e95e148de4b54a17025e527 | 57,123 | py | Python | monai/transforms/croppad/array.py | davidiommi/MONAI_0_7_0 | c288dd065ab18aaf018ea01b54f3ec515e6444dd | [
"Apache-2.0"
] | null | null | null | monai/transforms/croppad/array.py | davidiommi/MONAI_0_7_0 | c288dd065ab18aaf018ea01b54f3ec515e6444dd | [
"Apache-2.0"
] | null | null | null | monai/transforms/croppad/array.py | davidiommi/MONAI_0_7_0 | c288dd065ab18aaf018ea01b54f3ec515e6444dd | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | 47.761706 | 120 | 0.633825 |
from itertools import chain
from math import ceil
from typing import Any, Callable, List, Optional, Sequence, Tuple, Union
import numpy as np
import torch
from torch.nn.functional import pad as pad_pt
from monai.config import IndexSelection
from monai.config.type_definitions import NdarrayOrTensor
from mon... | true | true |
1c3bc0ca4ddaa841443813539b0429a144605411 | 320 | py | Python | audit_tools/users/apps.py | diegoauyon/audit_tools | c92e24b038a240222e275041585112c55a388587 | [
"MIT"
] | null | null | null | audit_tools/users/apps.py | diegoauyon/audit_tools | c92e24b038a240222e275041585112c55a388587 | [
"MIT"
] | null | null | null | audit_tools/users/apps.py | diegoauyon/audit_tools | c92e24b038a240222e275041585112c55a388587 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class UsersConfig(AppConfig):
name = "audit_tools.users"
verbose_name = _("Users")
def ready(self):
try:
import audit_tools.users.signals # noqa F401
except ImportError:
pass
| 22.857143 | 57 | 0.6625 | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class UsersConfig(AppConfig):
name = "audit_tools.users"
verbose_name = _("Users")
def ready(self):
try:
import audit_tools.users.signals
except ImportError:
pass
| true | true |
1c3bc0eb348601d75e6d8e8eee9dd1263abeeef7 | 2,553 | py | Python | tests/functional/test_help.py | kpinc/pip | 9ab837e30dc11be72a4cbbf103e6b4cdfbb3cbb0 | [
"MIT"
] | 1 | 2018-07-24T14:56:11.000Z | 2018-07-24T14:56:11.000Z | tests/functional/test_help.py | kpinc/pip | 9ab837e30dc11be72a4cbbf103e6b4cdfbb3cbb0 | [
"MIT"
] | null | null | null | tests/functional/test_help.py | kpinc/pip | 9ab837e30dc11be72a4cbbf103e6b4cdfbb3cbb0 | [
"MIT"
] | 1 | 2019-06-28T05:23:31.000Z | 2019-06-28T05:23:31.000Z | import pytest
from mock import Mock
from pip._internal.basecommand import ERROR, SUCCESS
from pip._internal.commands import commands_dict as commands
from pip._internal.commands.help import HelpCommand
from pip._internal.exceptions import CommandError
def test_run_method_should_return_success_when_finds_command_name... | 28.054945 | 79 | 0.680376 | import pytest
from mock import Mock
from pip._internal.basecommand import ERROR, SUCCESS
from pip._internal.commands import commands_dict as commands
from pip._internal.commands.help import HelpCommand
from pip._internal.exceptions import CommandError
def test_run_method_should_return_success_when_finds_command_name... | true | true |
1c3bc2d48eb7393dec3dbdb31c36e7909183d803 | 1,644 | py | Python | helpers/decorators.py | mfmviip/Arabic | 6687885cc795817677f892939860e4f196d11433 | [
"Apache-2.0"
] | null | null | null | helpers/decorators.py | mfmviip/Arabic | 6687885cc795817677f892939860e4f196d11433 | [
"Apache-2.0"
] | null | null | null | helpers/decorators.py | mfmviip/Arabic | 6687885cc795817677f892939860e4f196d11433 | [
"Apache-2.0"
] | null | null | null | # Calls Music 1 - Telegram bot for streaming audio in group calls
# Copyright (C) 2021 MFMVIP
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at y... | 33.55102 | 74 | 0.725061 |
from typing import Callable
from pyrogram import Client
from pyrogram.types import Message
from helpers.admins import get_administrators
from config import SUDO_USERS
def errors(func: Callable) -> Callable:
async def decorator(client: Client, message: Message):
try:
return a... | true | true |
1c3bc40597cbe01e2e381244860e4ccd246e1bc1 | 7,468 | py | Python | hyou/view.py | endast/hyou | e95455fde1c56707529283b17a333a2b8596edae | [
"Apache-2.0"
] | 1 | 2021-07-06T23:38:10.000Z | 2021-07-06T23:38:10.000Z | hyou/view.py | endast/hyou | e95455fde1c56707529283b17a333a2b8596edae | [
"Apache-2.0"
] | null | null | null | hyou/view.py | endast/hyou | e95455fde1c56707529283b17a333a2b8596edae | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 35.226415 | 79 | 0.595474 |
from __future__ import (
absolute_import, division, print_function, unicode_literals)
import six
from . import py3
from . import util
class View(util.CustomMutableFixedList):
def __init__(self, worksheet, api, start_row, end_row, start_col, end_col):
self._worksheet = worksheet
... | true | true |
1c3bc42d40ce6c3bf59f9f7448c64b5915065d1e | 1,245 | py | Python | tests/operators/test_zype_operator.py | Dminor7/airflow-provider-zype | 949b2665509ac12c3691ebd47e8ac3f641bd73de | [
"Apache-2.0"
] | null | null | null | tests/operators/test_zype_operator.py | Dminor7/airflow-provider-zype | 949b2665509ac12c3691ebd47e8ac3f641bd73de | [
"Apache-2.0"
] | null | null | null | tests/operators/test_zype_operator.py | Dminor7/airflow-provider-zype | 949b2665509ac12c3691ebd47e8ac3f641bd73de | [
"Apache-2.0"
] | null | null | null | """
Unittest module to test Operators.
Requires the unittest, pytest, and requests-mock Python libraries.
Run test:
python -m unittest tests.operators.test_zype_operator.TestZypeOperator
"""
import json
import logging
import os
import unittest
from unittest import mock
# Import Operator
from zype_provider.ope... | 23.055556 | 111 | 0.682731 |
import json
import logging
import os
import unittest
from unittest import mock
from zype_provider.operators.zype_operator import ZypeOperator
log = logging.getLogger(__name__)
@mock.patch.dict("os.environ", AIRFLOW_CONN_CONN_ZYPE="zype://:<YOUR_API_KEY>@")
class TestZypeOperator(unittest.TestCase):
def tes... | true | true |
1c3bc49c607f819f24310097910301e35f2df79c | 2,032 | py | Python | pykeyvi/tests/dictionary_compiler_test.py | jsdelivrbot/keyvi-1 | c56fb92da5eed655bf20e46d56f1e117b2556e3e | [
"Apache-2.0"
] | 147 | 2015-10-06T19:10:01.000Z | 2021-08-19T07:52:02.000Z | pykeyvi/tests/dictionary_compiler_test.py | jsdelivrbot/keyvi-1 | c56fb92da5eed655bf20e46d56f1e117b2556e3e | [
"Apache-2.0"
] | 148 | 2015-10-06T09:24:56.000Z | 2018-12-08T08:42:54.000Z | pykeyvi/tests/dictionary_compiler_test.py | jsdelivrbot/keyvi-1 | c56fb92da5eed655bf20e46d56f1e117b2556e3e | [
"Apache-2.0"
] | 34 | 2015-10-09T06:55:52.000Z | 2021-01-05T18:43:57.000Z | # -*- coding: utf-8 -*-
# Usage: py.test tests
import os
import pykeyvi
import shutil
import tempfile
import test_tools
from pytest import raises
def test_compiler_no_compile_edge_case():
c = pykeyvi.KeyOnlyDictionaryCompiler({"memory_limit_mb":"10"})
c.Add("abc")
c.Add("abd")
del c
def test_compile... | 27.459459 | 94 | 0.643701 |
import os
import pykeyvi
import shutil
import tempfile
import test_tools
from pytest import raises
def test_compiler_no_compile_edge_case():
c = pykeyvi.KeyOnlyDictionaryCompiler({"memory_limit_mb":"10"})
c.Add("abc")
c.Add("abd")
del c
def test_compiler_no_compile_edge_case_empty():
c = pykey... | true | true |
1c3bc5a85717b0debece6004bd124e39021b7f9a | 1,504 | py | Python | rdmo/views/views.py | m6121/rdmo | db3990c7525138c6ce9634fc3e5b6b8ee9b915c8 | [
"Apache-2.0"
] | 77 | 2016-08-09T11:40:20.000Z | 2022-03-06T11:03:26.000Z | rdmo/views/views.py | m6121/rdmo | db3990c7525138c6ce9634fc3e5b6b8ee9b915c8 | [
"Apache-2.0"
] | 377 | 2016-07-01T13:59:36.000Z | 2022-03-30T13:53:19.000Z | rdmo/views/views.py | m6121/rdmo | db3990c7525138c6ce9634fc3e5b6b8ee9b915c8 | [
"Apache-2.0"
] | 47 | 2016-06-23T11:32:19.000Z | 2022-03-01T11:34:37.000Z | import logging
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from django.views.generic import ListView, TemplateView
from rdmo.core.exports import XMLResponse
from rdmo.core.utils import get_model_field_meta, render_to_format
from rdmo.core.views import CSRFViewMixin, ModelPe... | 34.181818 | 105 | 0.724734 | import logging
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from django.views.generic import ListView, TemplateView
from rdmo.core.exports import XMLResponse
from rdmo.core.utils import get_model_field_meta, render_to_format
from rdmo.core.views import CSRFViewMixin, ModelPe... | true | true |
1c3bc63ed82243be89e16b8f67010dc1fd4599a0 | 21,647 | py | Python | pyIndego/indego_async_client.py | MagaliDB/pyIndego | 3764eb01b5ef6a2903c7eaede578208b32e755a1 | [
"MIT"
] | null | null | null | pyIndego/indego_async_client.py | MagaliDB/pyIndego | 3764eb01b5ef6a2903c7eaede578208b32e755a1 | [
"MIT"
] | null | null | null | pyIndego/indego_async_client.py | MagaliDB/pyIndego | 3764eb01b5ef6a2903c7eaede578208b32e755a1 | [
"MIT"
] | null | null | null | """API for Bosch API server for Indego lawn mower."""
import asyncio
import logging
from socket import error as SocketError
from typing import Any
import aiohttp
from aiohttp import (
ClientOSError,
ClientResponseError,
ServerTimeoutError,
TooManyRedirects,
)
from aiohttp.helpers import BasicAuth
from ... | 35.603618 | 127 | 0.571396 | import asyncio
import logging
from socket import error as SocketError
from typing import Any
import aiohttp
from aiohttp import (
ClientOSError,
ClientResponseError,
ServerTimeoutError,
TooManyRedirects,
)
from aiohttp.helpers import BasicAuth
from aiohttp.web_exceptions import HTTPGatewayTimeout
from... | true | true |
1c3bc64c5a559fb9951515855548dfdd9a4e1a71 | 207 | py | Python | 2014-1-bcc-ip-L5-DanilloMoraes/2014-1-bcc-ip-LISTA5/Q5.py | DanilloMLS/lista_de_exercicios | 4eb9ecfafec6804472218c9020d2a3715760a5a5 | [
"MIT"
] | null | null | null | 2014-1-bcc-ip-L5-DanilloMoraes/2014-1-bcc-ip-LISTA5/Q5.py | DanilloMLS/lista_de_exercicios | 4eb9ecfafec6804472218c9020d2a3715760a5a5 | [
"MIT"
] | null | null | null | 2014-1-bcc-ip-L5-DanilloMoraes/2014-1-bcc-ip-LISTA5/Q5.py | DanilloMLS/lista_de_exercicios | 4eb9ecfafec6804472218c9020d2a3715760a5a5 | [
"MIT"
] | null | null | null | def inserir(v,valor,p):
u=[]
pos=p-1
if pos<0:
pos=0
for i in range(0,len(v)):
if i==pos:
u.append(valor)
u.append(v[i])
return u
| 15.923077 | 30 | 0.400966 | def inserir(v,valor,p):
u=[]
pos=p-1
if pos<0:
pos=0
for i in range(0,len(v)):
if i==pos:
u.append(valor)
u.append(v[i])
return u
| true | true |
1c3bc73806d3e8bea7d8c6d8f48e0c8eb5dfd69f | 2,185 | bzl | Python | apple/bundling/clang_support.bzl | pwnartist/rules_apple | cc8a1f2b576c2b757940f93388d04a7789d9824e | [
"Apache-2.0"
] | null | null | null | apple/bundling/clang_support.bzl | pwnartist/rules_apple | cc8a1f2b576c2b757940f93388d04a7789d9824e | [
"Apache-2.0"
] | null | null | null | apple/bundling/clang_support.bzl | pwnartist/rules_apple | cc8a1f2b576c2b757940f93388d04a7789d9824e | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Bazel 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 la... | 34.140625 | 75 | 0.748741 |
load("@build_bazel_rules_apple//apple/bundling:bundling_support.bzl",
"bundling_support")
load("@build_bazel_rules_apple//apple/bundling:binary_support.bzl",
"binary_support")
load("@build_bazel_rules_apple//apple/bundling:file_support.bzl",
"file_support")
load("@build_bazel_rules_apple//app... | true | true |
1c3bc7749ef232c26ea63157494ddbc0cefeeb54 | 69,606 | py | Python | nipype/interfaces/afni/preprocess.py | dmordom/nipype | e815741ad68d63b7134b6db6225aabb0c38511ac | [
"BSD-3-Clause"
] | 1 | 2018-04-18T12:13:37.000Z | 2018-04-18T12:13:37.000Z | nipype/interfaces/afni/preprocess.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/afni/preprocess.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | 1 | 2021-09-08T14:31:47.000Z | 2021-09-08T14:31:47.000Z | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft = python sts = 4 ts = 4 sw = 4 et:
"""Afni preprocessing interfaces
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = o... | 35.934951 | 202 | 0.592061 |
import warnings
import os
import re
from ..base import (Directory, TraitedSpec,
traits, isdefined, File, InputMultiPath, Undefined)
from ...utils.filemanip import (load_json, save_json, split_filename)
from nipype.utils.filemanip import fname_presuffix
from .base import AFNICommand, AFNICommandI... | true | true |
1c3bcbd4de8004cfc4c637096f2b95baba76558f | 2,374 | py | Python | examples/dfp/v201608/order_service/get_orders_starting_soon.py | agencia-watermelons/googleads-python-lib | d2e55863ecf7e5090c225d74b3f4c1f948cd5a21 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201608/order_service/get_orders_starting_soon.py | agencia-watermelons/googleads-python-lib | d2e55863ecf7e5090c225d74b3f4c1f948cd5a21 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201608/order_service/get_orders_starting_soon.py | agencia-watermelons/googleads-python-lib | d2e55863ecf7e5090c225d74b3f4c1f948cd5a21 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 32.972222 | 80 | 0.634372 |
"""This example gets all orders that are starting soon.
"""
from datetime import datetime
from datetime import timedelta
from googleads import dfp
def main(client):
order_service = client.GetService('OrderService', version='v201608')
query = ('WHERE status = :status and startDateTime >= :now ... | false | true |
1c3bcce09af9641bcb3f62c534a49d3b56c740a5 | 3,282 | py | Python | models/.ipynb_checkpoints/position_encoding-checkpoint.py | jaehyek/deformable-DETR-2 | 930f36b9c491e35ce7870f2711c28243152ee058 | [
"MIT"
] | 12 | 2021-03-16T15:33:06.000Z | 2022-03-03T00:31:52.000Z | models/position_encoding.py | ver0z/Deformable-DETR | 7f1f4ffd1d716f681c7cbb2570e2c7a3d4bcf417 | [
"Apache-2.0"
] | 3 | 2021-07-15T20:55:13.000Z | 2022-01-20T11:56:05.000Z | models/position_encoding.py | ver0z/Deformable-DETR | 7f1f4ffd1d716f681c7cbb2570e2c7a3d4bcf417 | [
"Apache-2.0"
] | 6 | 2021-03-16T15:26:15.000Z | 2021-12-29T01:55:15.000Z |
"""
Various positional encodings for the transformer.
"""
import math
import torch
from torch import nn
from util.misc import NestedTensor
class PositionEmbeddingSine(nn.Module):
"""
This is a more standard version of the position embedding, very similar to the one
used by the Attention is all you need ... | 36.466667 | 103 | 0.618221 |
import math
import torch
from torch import nn
from util.misc import NestedTensor
class PositionEmbeddingSine(nn.Module):
def __init__(self, num_pos_feats=64, temperature=10000, normalize=False, scale=None):
super().__init__()
self.num_pos_feats = num_pos_feats
self.temperature = temperat... | true | true |
1c3bcd602197858f1701e139a57d06f0ab74f495 | 62,326 | py | Python | rcnn/lib/python3.6/site-packages/tensorflow/compiler/xla/xla_data_pb2.py | dreamingweaver/making_passportImage | 68f23411780ff82abe934dfae5fc04acb80f2c49 | [
"MIT"
] | 1 | 2019-01-12T13:17:32.000Z | 2019-01-12T13:17:32.000Z | rcnn/lib/python3.6/site-packages/tensorflow/compiler/xla/xla_data_pb2.py | dreamingweaver/making_passportImage | 68f23411780ff82abe934dfae5fc04acb80f2c49 | [
"MIT"
] | null | null | null | rcnn/lib/python3.6/site-packages/tensorflow/compiler/xla/xla_data_pb2.py | dreamingweaver/making_passportImage | 68f23411780ff82abe934dfae5fc04acb80f2c49 | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/compiler/xla/xla_data.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.prot... | 39.723391 | 6,055 | 0.744794 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf... | true | true |
1c3bce0e68d6cb50bf6de6908d0001125204b025 | 817 | py | Python | v2/goalnet/core/modules/logger.py | DaniloZZZ/GoalNet | d24102a5f0700fbf42c0868b321d6f6a097ee97b | [
"Apache-2.0"
] | null | null | null | v2/goalnet/core/modules/logger.py | DaniloZZZ/GoalNet | d24102a5f0700fbf42c0868b321d6f6a097ee97b | [
"Apache-2.0"
] | null | null | null | v2/goalnet/core/modules/logger.py | DaniloZZZ/GoalNet | d24102a5f0700fbf42c0868b321d6f6a097ee97b | [
"Apache-2.0"
] | null | null | null | """
Created by Danil Lykov @danlkv on 13/02/19
"""
from pprint import pprint
import multiprocessing as prc
from goalnet.helpers.log_init import log
from goalnet.utils import get_network_config
from .AsyncBaseModule import AsyncModule
class LoggerModule(AsyncModule):
"""
A simple module that logs everything a... | 24.029412 | 68 | 0.709914 |
from pprint import pprint
import multiprocessing as prc
from goalnet.helpers.log_init import log
from goalnet.utils import get_network_config
from .AsyncBaseModule import AsyncModule
class LoggerModule(AsyncModule):
def __init__(self, netconf,name='logger'):
super().__init__(netconf, name=name)
asyn... | true | true |
1c3bce42ea29a20fbb907c8b16ed4eb577176d89 | 4,185 | py | Python | pypy/rlib/test/test_rweakkeydict.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | 1 | 2020-01-21T11:10:51.000Z | 2020-01-21T11:10:51.000Z | pypy/rlib/test/test_rweakkeydict.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | pypy/rlib/test/test_rweakkeydict.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | import py
from pypy.rlib import rgc
from pypy.rlib.rweakref import RWeakKeyDictionary
from pypy.rpython.test.test_llinterp import interpret
class KX(object):
pass
class KY(KX):
pass
class VX(object):
pass
class VY(VX):
pass
def make_test(loop=100, prebuilt=None):
def g(d):
assert d.get... | 25.05988 | 72 | 0.519235 | import py
from pypy.rlib import rgc
from pypy.rlib.rweakref import RWeakKeyDictionary
from pypy.rpython.test.test_llinterp import interpret
class KX(object):
pass
class KY(KX):
pass
class VX(object):
pass
class VY(VX):
pass
def make_test(loop=100, prebuilt=None):
def g(d):
assert d.get... | true | true |
1c3bcea52be1a62af86608ca35e65fa11993e1bb | 547,683 | py | Python | HLTrigger/Configuration/test/OnLine_HLT_PRef.py | DenkMybu/cmssw | 70b770f8d71f81469ef7f171c16d4d8958826d6e | [
"Apache-2.0"
] | null | null | null | HLTrigger/Configuration/test/OnLine_HLT_PRef.py | DenkMybu/cmssw | 70b770f8d71f81469ef7f171c16d4d8958826d6e | [
"Apache-2.0"
] | null | null | null | HLTrigger/Configuration/test/OnLine_HLT_PRef.py | DenkMybu/cmssw | 70b770f8d71f81469ef7f171c16d4d8958826d6e | [
"Apache-2.0"
] | null | null | null | # hltGetConfiguration --full --data /dev/CMSSW_12_3_0/PRef --type PRef --unprescale --process HLTPRef --globaltag auto:run3_hlt_PRef --input file:RelVal_Raw_PRef_DATA.root
# /dev/CMSSW_12_3_0/PRef/V23 (CMSSW_12_3_0_pre4)
import FWCore.ParameterSet.Config as cms
from HeterogeneousCore.CUDACore.SwitchProducerCUDA impo... | 48.105665 | 2,125 | 0.707365 |
import FWCore.ParameterSet.Config as cms
from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA
process = cms.Process( "HLTPRef" )
process.HLTConfigVersion = cms.PSet(
tableName = cms.string('/dev/CMSSW_12_3_0/PRef/V23')
)
process.transferSystem = cms.PSet(
destinations = cms.vstring(... | true | true |
1c3bcf3dc6e052bdc7a8df651270ee43c31116ec | 289 | py | Python | codecs/codecs_stdout.py | all3g/pieces | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 34 | 2016-10-31T02:05:24.000Z | 2018-11-08T14:33:13.000Z | codecs/codecs_stdout.py | join-us/python-programming | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 2 | 2017-05-11T03:00:31.000Z | 2017-11-01T23:37:37.000Z | codecs/codecs_stdout.py | join-us/python-programming | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 21 | 2016-08-19T09:05:45.000Z | 2018-11-08T14:33:16.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
import codecs
import sys
text = u'pi: π'
# Printing to stdout may cause an encoding error
print 'Default encoding:', sys.stdout.encoding
print 'TTY:', sys.stdout.isatty()
print text
| 16.055556 | 55 | 0.698962 |
import codecs
import sys
text = u'pi: π'
print 'Default encoding:', sys.stdout.encoding
print 'TTY:', sys.stdout.isatty()
print text
| false | true |
1c3bd12c2509fbbc3cd382544adb42425da721b8 | 214 | py | Python | users/urls.py | tomuhenry/wonya-backend | d54360e8d5d5363e4bf5471fb81d732a221e37c9 | [
"MIT"
] | 3 | 2020-06-16T22:28:05.000Z | 2020-06-17T10:07:00.000Z | users/urls.py | tomuhenry/wonya-backend | d54360e8d5d5363e4bf5471fb81d732a221e37c9 | [
"MIT"
] | 3 | 2020-06-17T11:04:31.000Z | 2021-04-08T21:09:07.000Z | users/urls.py | tomuhenry/wonya-backend | d54360e8d5d5363e4bf5471fb81d732a221e37c9 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
app_name = 'users'
urlpatterns = [
path('', include('rest_auth.urls')),
path('register/', include('rest_auth.registration.urls')),
]
| 21.4 | 62 | 0.705607 | from django.contrib import admin
from django.urls import path, include
app_name = 'users'
urlpatterns = [
path('', include('rest_auth.urls')),
path('register/', include('rest_auth.registration.urls')),
]
| true | true |
1c3bd1d2a2eba796bbc6c2d572f4e7f6f5aa296d | 137 | py | Python | jsonfield/__init__.py | alexsilva/django-jsonfield | 37499674f62073baa7306fa6a9ae2721c72d2120 | [
"BSD-3-Clause"
] | null | null | null | jsonfield/__init__.py | alexsilva/django-jsonfield | 37499674f62073baa7306fa6a9ae2721c72d2120 | [
"BSD-3-Clause"
] | null | null | null | jsonfield/__init__.py | alexsilva/django-jsonfield | 37499674f62073baa7306fa6a9ae2721c72d2120 | [
"BSD-3-Clause"
] | null | null | null | import os
from jsonfield.fields import JSONField
__version__ = open(os.path.join(os.path.dirname(__file__), 'VERSION')).read().strip()
| 22.833333 | 85 | 0.759124 | import os
from jsonfield.fields import JSONField
__version__ = open(os.path.join(os.path.dirname(__file__), 'VERSION')).read().strip()
| true | true |
1c3bd36a5104a45808c96e6ecc8528009f469bec | 1,587 | py | Python | utils/views.py | dayraliz99/gmeBox | 82e7a19cf69452a469d09063146b215413db886b | [
"Apache-2.0"
] | null | null | null | utils/views.py | dayraliz99/gmeBox | 82e7a19cf69452a469d09063146b215413db886b | [
"Apache-2.0"
] | null | null | null | utils/views.py | dayraliz99/gmeBox | 82e7a19cf69452a469d09063146b215413db886b | [
"Apache-2.0"
] | null | null | null | from django.core.exceptions import PermissionDenied
class CustomUserOnlyMixin(object):
"""
Permite personalizar los permisos de acceso para los views
"""
permissions_required = None
def has_permissions(self):
if self.request.user.is_active is False:
return False
if sel... | 31.74 | 66 | 0.627599 | from django.core.exceptions import PermissionDenied
class CustomUserOnlyMixin(object):
permissions_required = None
def has_permissions(self):
if self.request.user.is_active is False:
return False
if self.request.user.is_superuser is True:
return True
groups = s... | true | true |
1c3bd7d8a3f08cc0b0e10770c6b45638d2469949 | 1,934 | py | Python | AnaphoraFinder.py | Studi60Lax/Rhetorical-Analysis | b4020d9c72e63b3dfebbd88d1234de9a1e31fe82 | [
"MIT"
] | 4 | 2019-10-20T17:44:02.000Z | 2022-03-28T14:30:50.000Z | AnaphoraFinder.py | Studi60Lax/Rhetorical-Analysis | b4020d9c72e63b3dfebbd88d1234de9a1e31fe82 | [
"MIT"
] | null | null | null | AnaphoraFinder.py | Studi60Lax/Rhetorical-Analysis | b4020d9c72e63b3dfebbd88d1234de9a1e31fe82 | [
"MIT"
] | 1 | 2020-02-02T07:07:40.000Z | 2020-02-02T07:07:40.000Z | from nltk import word_tokenize
class AnaphoraFinder:
def __init__(self):
self.f = ""
self.counter = 0
self.first_word = ""
self.b = False
#Path is inputted from AIPController
#Returns anaphora counter
def sendFile(self, path):
self.f = open(path)
... | 29.753846 | 75 | 0.481386 | from nltk import word_tokenize
class AnaphoraFinder:
def __init__(self):
self.f = ""
self.counter = 0
self.first_word = ""
self.b = False
def sendFile(self, path):
self.f = open(path)
for line in self.f:
try:
if se... | true | true |
1c3bd8ccdf41231c75a57e6117b39384dd93605d | 3,073 | py | Python | py/evaluate.py | wjbKimberly/poseval-wjb | 0b71010a01f0ec8f30db3b523ecfa8c800b397e3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | py/evaluate.py | wjbKimberly/poseval-wjb | 0b71010a01f0ec8f30db3b523ecfa8c800b397e3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | py/evaluate.py | wjbKimberly/poseval-wjb | 0b71010a01f0ec8f30db3b523ecfa8c800b397e3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | import json
import os
import sys
import numpy as np
import argparse
from evaluateAP import evaluateAP
from evaluateTracking import evaluateTracking
import eval_helpers
from eval_helpers import Joint
def parseArgs():
parser = argparse.ArgumentParser(description="Evaluation of Pose Estimation and Tr... | 42.09589 | 166 | 0.65864 | import json
import os
import sys
import numpy as np
import argparse
from evaluateAP import evaluateAP
from evaluateTracking import evaluateTracking
import eval_helpers
from eval_helpers import Joint
def parseArgs():
parser = argparse.ArgumentParser(description="Evaluation of Pose Estimation and Tr... | false | true |
1c3bd8efbe0b47e5e3dd582d5599cf423a55c082 | 4,430 | py | Python | napari/_qt/tests/test_qt_dims.py | arokem/napari | e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd | [
"BSD-3-Clause"
] | null | null | null | napari/_qt/tests/test_qt_dims.py | arokem/napari | e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd | [
"BSD-3-Clause"
] | 1 | 2019-09-18T22:59:55.000Z | 2019-09-23T16:41:08.000Z | napari/_qt/tests/test_qt_dims.py | arokem/napari | e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from napari.components import Dims
from napari._qt.qt_dims import QtDims
def test_creating_view(qtbot):
"""
Test creating dims view.
"""
ndim = 4
dims = Dims(ndim)
view = QtDims(dims)
qtbot.addWidget(view)
# Check that the dims model has been appended to the dims ... | 30.763889 | 79 | 0.669752 | import numpy as np
from napari.components import Dims
from napari._qt.qt_dims import QtDims
def test_creating_view(qtbot):
ndim = 4
dims = Dims(ndim)
view = QtDims(dims)
qtbot.addWidget(view)
assert view.dims == dims
assert view.nsliders == view.dims.ndim
assert np.sum(v... | true | true |
1c3bd95b330ff1dc43faa1814ed8f9bf4188d8ab | 686 | py | Python | i2c_responder/calc_icmpv6_chksum.py | ddgarrett/mbos | 58ca81fa518c4cbad77fb83f58120bfe1495482e | [
"MIT"
] | null | null | null | i2c_responder/calc_icmpv6_chksum.py | ddgarrett/mbos | 58ca81fa518c4cbad77fb83f58120bfe1495482e | [
"MIT"
] | null | null | null | i2c_responder/calc_icmpv6_chksum.py | ddgarrett/mbos | 58ca81fa518c4cbad77fb83f58120bfe1495482e | [
"MIT"
] | null | null | null | from struct import unpack
def calc_icmpv6_chksum(packet):
"""Calculate the ICMPv6 checksum for a packet.
:param packet: The packet bytes to checksum.
:returns: The checksum integer.
from: https://www.programcreek.com/python/?CodeExample=calculate+checksum
"""
total = 0
# Add up ... | 26.384615 | 77 | 0.61516 | from struct import unpack
def calc_icmpv6_chksum(packet):
total = 0
num_words = len(packet) // 2
for chunk in unpack("!%sH" % num_words, packet[0:num_words * 2]):
total += chunk
if len(packet) % 2:
total += packet[-1] << 8
total = (total >> 16) + (total & 0xffff)
... | true | true |
1c3bdb24cdb1ae51082f0482d8a76ee462ef1546 | 4,527 | py | Python | megadoot/megadoot.py | mayanks0ni/modmail-plugins | 82df5f13d2cc016af0792f2c42314577101553d3 | [
"MIT"
] | 14 | 2019-08-09T09:59:46.000Z | 2020-09-30T10:20:46.000Z | megadoot/megadoot.py | mayanks0ni/modmail-plugins | 82df5f13d2cc016af0792f2c42314577101553d3 | [
"MIT"
] | 1,093 | 2019-11-14T09:57:33.000Z | 2021-11-08T04:56:29.000Z | megadoot/megadoot.py | mayanks0ni/modmail-plugins | 82df5f13d2cc016af0792f2c42314577101553d3 | [
"MIT"
] | 38 | 2019-08-09T16:44:44.000Z | 2022-03-20T16:45:40.000Z | import random
import discord
from discord.ext import commands
class Megadoot(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.fights = [
'{0} tried to throw a snowball at {1} but it hits Dabbit\'s car, and Dabbit is not pleased!',
'{0} tackled {1} down ... | 61.175676 | 184 | 0.578529 | import random
import discord
from discord.ext import commands
class Megadoot(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.fights = [
'{0} tried to throw a snowball at {1} but it hits Dabbit\'s car, and Dabbit is not pleased!',
'{0} tackled {1} down ... | true | true |
1c3bdb32fc865ce079b625627d488a6b11d6b380 | 7,138 | py | Python | veriloggen/stream/scheduler.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | 232 | 2015-09-01T16:07:48.000Z | 2022-03-28T14:53:28.000Z | veriloggen/stream/scheduler.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | 34 | 2015-08-21T09:13:03.000Z | 2022-03-21T23:52:44.000Z | veriloggen/stream/scheduler.py | jesseclin/veriloggen | a645f2c53f04e5b88213eef17779d212192ea2b5 | [
"Apache-2.0"
] | 46 | 2015-09-24T14:39:57.000Z | 2022-02-23T21:59:56.000Z | from __future__ import absolute_import
from __future__ import print_function
from . import stypes
from .visitor import _Visitor
class _Scheduler(_Visitor):
def max_stage(self, *vars):
return stypes._max(*vars)
def next_stage(self, node, stage):
if stage is None:
return 0
... | 36.793814 | 91 | 0.60283 | from __future__ import absolute_import
from __future__ import print_function
from . import stypes
from .visitor import _Visitor
class _Scheduler(_Visitor):
def max_stage(self, *vars):
return stypes._max(*vars)
def next_stage(self, node, stage):
if stage is None:
return 0
... | true | true |
1c3bdbf32ed8ebc506854076d2d9c825108d5262 | 440 | py | Python | app.py | AcharyaRakesh/Baldness-Prediction | f97c3bf1f068b167405f3bc711a7f6630905da2e | [
"MIT"
] | null | null | null | app.py | AcharyaRakesh/Baldness-Prediction | f97c3bf1f068b167405f3bc711a7f6630905da2e | [
"MIT"
] | null | null | null | app.py | AcharyaRakesh/Baldness-Prediction | f97c3bf1f068b167405f3bc711a7f6630905da2e | [
"MIT"
] | null | null | null |
from main import load_model
model = load_model('model.h5')
import numpy as np
from tensorflow.keras.preprocessing import image
test_image = image.load_img('',target_size=(64,64) )
test_image = image.img_to_array(test_image)
test_image = test_image/255
test_image=np.expand_dims(test_image,axis=0)
result = ... | 25.882353 | 53 | 0.736364 |
from main import load_model
model = load_model('model.h5')
import numpy as np
from tensorflow.keras.preprocessing import image
test_image = image.load_img('',target_size=(64,64) )
test_image = image.img_to_array(test_image)
test_image = test_image/255
test_image=np.expand_dims(test_image,axis=0)
result = ... | true | true |
1c3bdca0bbd1a7ab4b6286aab45327684c4f6227 | 7,131 | py | Python | ze_trajectory_analysis/py/ze_trajectory_analysis/consistency_single_run.py | rockenbf/ze_oss | ee04158e2d51acb07a267196f618e9afbc3ffd83 | [
"BSD-3-Clause"
] | 30 | 2016-09-27T07:41:28.000Z | 2021-12-03T20:44:28.000Z | ze_trajectory_analysis/py/ze_trajectory_analysis/consistency_single_run.py | rockenbf/ze_oss | ee04158e2d51acb07a267196f618e9afbc3ffd83 | [
"BSD-3-Clause"
] | 1 | 2018-12-18T15:53:06.000Z | 2018-12-21T03:10:06.000Z | ze_trajectory_analysis/py/ze_trajectory_analysis/consistency_single_run.py | rockenbf/ze_oss | ee04158e2d51acb07a267196f618e9afbc3ffd83 | [
"BSD-3-Clause"
] | 12 | 2016-11-05T07:51:29.000Z | 2020-07-13T02:26:08.000Z | #!/usr/bin/python3
"""
Zurich Eye
"""
import os
import yaml
import logging
import argparse
import numpy as np
import ze_trajectory_analysis.analyse as traj_analysis
import ze_py.transformations as tf
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import vikit_py.transformations as tf
from matpl... | 37.335079 | 109 | 0.697097 |
import os
import yaml
import logging
import argparse
import numpy as np
import ze_trajectory_analysis.analyse as traj_analysis
import ze_py.transformations as tf
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import vikit_py.transformations as tf
from matplotlib import rc
from matplotlib.ticke... | true | true |
1c3bde8ca6b6b305dd3385b8719759404968c735 | 6,169 | py | Python | basicsr/utils/img_util.py | IanYeung/ReCp | 1a7ace0e1ca3c262e24a222f3f0ab0d5674e9410 | [
"Apache-2.0",
"MIT"
] | null | null | null | basicsr/utils/img_util.py | IanYeung/ReCp | 1a7ace0e1ca3c262e24a222f3f0ab0d5674e9410 | [
"Apache-2.0",
"MIT"
] | null | null | null | basicsr/utils/img_util.py | IanYeung/ReCp | 1a7ace0e1ca3c262e24a222f3f0ab0d5674e9410 | [
"Apache-2.0",
"MIT"
] | null | null | null | import cv2
import math
import numpy as np
import os
import torch
from torchvision.utils import make_grid
def normalize(imgs):
def _norm(img):
return img.astype(np.float32) / 255.
if isinstance(imgs, list):
return [_norm(img) for img in imgs]
else:
return _norm(imgs)
def img2ten... | 31.963731 | 79 | 0.58486 | import cv2
import math
import numpy as np
import os
import torch
from torchvision.utils import make_grid
def normalize(imgs):
def _norm(img):
return img.astype(np.float32) / 255.
if isinstance(imgs, list):
return [_norm(img) for img in imgs]
else:
return _norm(imgs)
def img2ten... | true | true |
1c3bde9c0433366821197ae865f4d4b41ed5c11f | 2,182 | py | Python | AlgorithmFactories/ClassificationAlgorithmFactories/LogisticRegressionAlgorithmFactory.py | CzakoZoltan08/COVID-19-patient-filtering-using-AutomaticAI | 87c4cb1d2848a0258b0b6d652316cb69de382ff0 | [
"MIT"
] | 1 | 2021-07-26T19:42:50.000Z | 2021-07-26T19:42:50.000Z | AlgorithmFactories/ClassificationAlgorithmFactories/LogisticRegressionAlgorithmFactory.py | CzakoZoltan08/COVID-19-patient-filtering-using-AutomaticAI | 87c4cb1d2848a0258b0b6d652316cb69de382ff0 | [
"MIT"
] | null | null | null | AlgorithmFactories/ClassificationAlgorithmFactories/LogisticRegressionAlgorithmFactory.py | CzakoZoltan08/COVID-19-patient-filtering-using-AutomaticAI | 87c4cb1d2848a0258b0b6d652316cb69de382ff0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 23 12:28:07 2019
@author: czzo
"""
from collections import OrderedDict
from sklearn.linear_model import LogisticRegression
from ..Algorithm import Algorithm
const_param_logistic_regression = {
'verbose': 0,
'dual': False,
'class_weight': 'balanced',
... | 36.983051 | 111 | 0.733731 |
from collections import OrderedDict
from sklearn.linear_model import LogisticRegression
from ..Algorithm import Algorithm
const_param_logistic_regression = {
'verbose': 0,
'dual': False,
'class_weight': 'balanced',
'penalty': 'l1'
}
dicrete_hyper_parameter_list_of_solvers = ["liblinear", "newto... | true | true |
1c3bdf860d07d8873256e558cc2afbd911e03629 | 4,166 | py | Python | cremiFPsplitonly.py | VCG/gp | cd106b604f8670a70add469d41180e34df3b1068 | [
"MIT"
] | null | null | null | cremiFPsplitonly.py | VCG/gp | cd106b604f8670a70add469d41180e34df3b1068 | [
"MIT"
] | null | null | null | cremiFPsplitonly.py | VCG/gp | cd106b604f8670a70add469d41180e34df3b1068 | [
"MIT"
] | null | null | null |
import gp
import cPickle as pickle
import numpy as np
import os
HOMEDIR = '/n/home05/haehn/'
REGALDIR = '/n/regal/pfister_lab/haehn/'
DATADIR = HOMEDIR + 'data/CREMIGP/TEST/'
OUTDIR = REGALDIR + 'CREMIBIGSPLITONLY_FP/'
#
# load cnn
#
with open('nets/IPMLB_FULL_CREMI_FINAL.p', 'rb') as f:
cnn = pickle.load(f)
cnn... | 24.362573 | 259 | 0.733077 |
import gp
import cPickle as pickle
import numpy as np
import os
HOMEDIR = '/n/home05/haehn/'
REGALDIR = '/n/regal/pfister_lab/haehn/'
DATADIR = HOMEDIR + 'data/CREMIGP/TEST/'
OUTDIR = REGALDIR + 'CREMIBIGSPLITONLY_FP/'
with open('nets/IPMLB_FULL_CREMI_FINAL.p', 'rb') as f:
cnn = pickle.load(f)
cnn.uuid = 'IPM... | false | true |
1c3be05818eb09a29d2c3fb648e19af0b8059c8d | 10,447 | py | Python | pip/resolve.py | lyw07/kolibripip | e7039eca92b61827faa754311f1489e89a11519d | [
"MIT"
] | null | null | null | pip/resolve.py | lyw07/kolibripip | e7039eca92b61827faa754311f1489e89a11519d | [
"MIT"
] | null | null | null | pip/resolve.py | lyw07/kolibripip | e7039eca92b61827faa754311f1489e89a11519d | [
"MIT"
] | null | null | null | """Dependency Resolution
The dependency resolution in pip is performed as follows:
for top-level requirements:
a. only one spec allowed per project, regardless of conflicts or not.
otherwise a "double requirement" exception is raised
b. they override sub-dependency requirements.
for sub-dependencies
... | 39.722433 | 79 | 0.615679 |
import logging
from itertools import chain
from pip.exceptions import (
BestVersionAlreadyInstalled,
DistributionNotFound, HashError, HashErrors, UnsupportedPythonVersion
)
from pip.req.req_install import InstallRequirement
from pip.utils import dist_in_usersite, ensure_dir
from pip.utils.logging import inden... | true | true |
1c3be1d05a6dd4619a12e37be7a86cf50a72ae07 | 2,307 | py | Python | backend/content_faith_recor_33375/urls.py | crowdbotics-apps/content-faith-recor-33375 | 3f6ff2b7833f282d1136d477c6a533591dd5fb63 | [
"FTL",
"AML",
"RSA-MD"
] | 1 | 2022-02-05T03:02:39.000Z | 2022-02-05T03:02:39.000Z | backend/content_faith_recor_33375/urls.py | crowdbotics-apps/content-faith-recor-33375 | 3f6ff2b7833f282d1136d477c6a533591dd5fb63 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/content_faith_recor_33375/urls.py | crowdbotics-apps/content-faith-recor-33375 | 3f6ff2b7833f282d1136d477c6a533591dd5fb63 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """content_faith_recor_33375 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='... | 36.619048 | 87 | 0.717815 |
from django.contrib import admin
from django.urls import path, include, re_path
from django.views.generic.base import TemplateView
from allauth.account.views import confirm_email
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
urlpatterns = [
path("",... | true | true |
1c3be326bf00b9905fe2485f4e6ee3a8b341b075 | 5,403 | py | Python | xray/backends/common.py | eriknw/xray | 19df8d202b1d8054019e7e42365c67cdde6ff448 | [
"Apache-2.0"
] | null | null | null | xray/backends/common.py | eriknw/xray | 19df8d202b1d8054019e7e42365c67cdde6ff448 | [
"Apache-2.0"
] | null | null | null | xray/backends/common.py | eriknw/xray | 19df8d202b1d8054019e7e42365c67cdde6ff448 | [
"Apache-2.0"
] | 1 | 2020-02-05T00:19:02.000Z | 2020-02-05T00:19:02.000Z | import numpy as np
import itertools
from collections import Mapping
from ..core.utils import FrozenOrderedDict
from ..core.pycompat import iteritems
from ..core.variable import Coordinate
NONE_VAR_NAME = '__values__'
def _encode_variable_name(name):
if name is None:
name = NONE_VAR_NAME
return nam... | 31.051724 | 82 | 0.635388 | import numpy as np
import itertools
from collections import Mapping
from ..core.utils import FrozenOrderedDict
from ..core.pycompat import iteritems
from ..core.variable import Coordinate
NONE_VAR_NAME = '__values__'
def _encode_variable_name(name):
if name is None:
name = NONE_VAR_NAME
return nam... | true | true |
1c3be36c98aa6bb261b2a02b8e62a5a9a521c7b8 | 9,295 | py | Python | main.py | nsobczak/tic-tac-toe | 6b44ed29bdba4d9ddaa680591c8cc6aa9e06f22e | [
"MIT"
] | null | null | null | main.py | nsobczak/tic-tac-toe | 6b44ed29bdba4d9ddaa680591c8cc6aa9e06f22e | [
"MIT"
] | null | null | null | main.py | nsobczak/tic-tac-toe | 6b44ed29bdba4d9ddaa680591c8cc6aa9e06f22e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
###############
# tic-tac-toe #
###############
Created on Tue Apr 14 17:08:22 2015
@author: Nicolas Sobczak
"""
# %%____________________________________________________________________________________________________
# Config
# Import
import random as rdm
import numpy as ... | 25.053908 | 105 | 0.471544 |
import random as rdm
import numpy as np
from copy import deepcopy
grilleVide = np.array([[0, 0, 0],
[0, 0, 0],
[0, 0, 0]])
dico = {}
dico['L1'] = ([1, 1], [1, 2], [1, 3])
dico['L2'] = ([2, 1], [2, 2], [2, 3])
dico['L3'] = ([3, 1], [3, 2], [3, 3])
dic... | true | true |
1c3be38f9a2e2b8f10e434b26589fe509b0b9df5 | 1,130 | py | Python | src/hexlet/fs/__init__.py | hexlet-components/python-immutable-fs-trees | 992df582993469da4437434fad09fe8fefbaae68 | [
"0BSD"
] | 3 | 2020-09-24T17:13:01.000Z | 2022-01-27T18:58:41.000Z | src/hexlet/fs/__init__.py | hexlet-components/python-immutable-fs-trees | 992df582993469da4437434fad09fe8fefbaae68 | [
"0BSD"
] | 3 | 2020-11-11T15:07:40.000Z | 2022-01-25T20:54:59.000Z | src/hexlet/fs/__init__.py | hexlet-components/python-immutable-fs-trees | 992df582993469da4437434fad09fe8fefbaae68 | [
"0BSD"
] | 7 | 2020-09-13T15:33:16.000Z | 2022-01-19T03:08:36.000Z | # coding: utf-8
__all__ = (
'mkfile', 'mkdir',
'is_file', 'is_directory',
)
def mkfile(name, meta={}):
"""Return file node."""
return {
'name': name,
'meta': meta,
'type': 'file'
}
def mkdir(name, children=[], meta={}):
"""Return directory node."""
return {
... | 17.121212 | 42 | 0.533628 |
__all__ = (
'mkfile', 'mkdir',
'is_file', 'is_directory',
)
def mkfile(name, meta={}):
return {
'name': name,
'meta': meta,
'type': 'file'
}
def mkdir(name, children=[], meta={}):
return {
'name': name,
'children': children,
'meta': meta,
... | true | true |
1c3be4ac14d210a3695a7a37e502d4ea9d56c2d8 | 2,373 | py | Python | docs/conf.py | Linuxiston/linuxiston_uz | 5687df6922a53b58f13ba5554f4a70dd9871ef2a | [
"MIT"
] | null | null | null | docs/conf.py | Linuxiston/linuxiston_uz | 5687df6922a53b58f13ba5554f4a70dd9871ef2a | [
"MIT"
] | 4 | 2021-03-10T08:56:07.000Z | 2021-05-12T06:04:52.000Z | docs/conf.py | Linuxiston/linuxiston_uz | 5687df6922a53b58f13ba5554f4a70dd9871ef2a | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 37.078125 | 79 | 0.671302 |
import os
import sys
import django
if os.getenv("READTHEDOCS", default=False) == "True":
sys.path.insert(0, os.path.abspath(".."))
os.environ["DJANGO_READ_DOT_ENV_FILE"] = "True"
os.environ["USE_DOCKER"] = "no"
else:
sys.path.insert(0, os.path.abspath("/app"))
os.environ["DATABASE_URL"] = "... | true | true |
1c3be675a8450793c01dc0047a6380d459dcb4b4 | 5,367 | py | Python | tests/test_cmd_forget.py | samuelsinayoko/doit | e7aa4f5f399c65bf9567ced9fb2673d52d9d6c92 | [
"MIT"
] | 1,390 | 2015-01-01T21:11:47.000Z | 2022-03-31T11:35:44.000Z | tests/test_cmd_forget.py | samuelsinayoko/doit | e7aa4f5f399c65bf9567ced9fb2673d52d9d6c92 | [
"MIT"
] | 393 | 2015-01-05T11:18:29.000Z | 2022-03-20T11:46:46.000Z | tests/test_cmd_forget.py | samuelsinayoko/doit | e7aa4f5f399c65bf9567ced9fb2673d52d9d6c92 | [
"MIT"
] | 176 | 2015-01-07T16:58:56.000Z | 2022-03-28T12:12:11.000Z | from io import StringIO
import pytest
from doit.exceptions import InvalidCommand
from doit.dependency import DbmDB, Dependency
from doit.cmd_forget import Forget
from .conftest import tasks_sample, CmdFactory
class TestCmdForget(object):
@pytest.fixture
def tasks(self, request):
return tasks_sample... | 40.969466 | 90 | 0.602758 | from io import StringIO
import pytest
from doit.exceptions import InvalidCommand
from doit.dependency import DbmDB, Dependency
from doit.cmd_forget import Forget
from .conftest import tasks_sample, CmdFactory
class TestCmdForget(object):
@pytest.fixture
def tasks(self, request):
return tasks_sample... | true | true |
1c3be6c578a2858b8a6ed8f3d43e5684f6edad78 | 1,199 | py | Python | backend/library/coro.py | the-lans/FastAPITemplate | 51c25622944b26fde545fec1824b2e334b020662 | [
"MIT"
] | 2 | 2021-08-15T09:07:21.000Z | 2021-08-15T21:03:37.000Z | backend/library/coro.py | the-lans/YaML | cded6010b800f9a0bf00e50f0a144d9b1fc85959 | [
"MIT"
] | null | null | null | backend/library/coro.py | the-lans/YaML | cded6010b800f9a0bf00e50f0a144d9b1fc85959 | [
"MIT"
] | 1 | 2021-08-15T21:03:40.000Z | 2021-08-15T21:03:40.000Z | import asyncio
from datetime import timedelta
from typing import Union
from backend.library.func import call_func
def get_loop():
"""
:return: current loop
"""
try:
return asyncio.get_event_loop()
except RuntimeError:
return loop
loop = get_loop()
async def run_coro_after(coro... | 21.8 | 80 | 0.655546 | import asyncio
from datetime import timedelta
from typing import Union
from backend.library.func import call_func
def get_loop():
try:
return asyncio.get_event_loop()
except RuntimeError:
return loop
loop = get_loop()
async def run_coro_after(coro, time: Union[float, timedelta]):
if i... | true | true |
1c3be71ee094276ee43ab6d1f528d53421b89e41 | 422 | py | Python | Python_Exercicios/Mundo2/Repetições em Python (for)/python_047.py | jbauermanncode/Curso_Em_Video_Python | 330c207d7bed4e663fe1b9ab433ab57a9828b7f1 | [
"MIT"
] | null | null | null | Python_Exercicios/Mundo2/Repetições em Python (for)/python_047.py | jbauermanncode/Curso_Em_Video_Python | 330c207d7bed4e663fe1b9ab433ab57a9828b7f1 | [
"MIT"
] | null | null | null | Python_Exercicios/Mundo2/Repetições em Python (for)/python_047.py | jbauermanncode/Curso_Em_Video_Python | 330c207d7bed4e663fe1b9ab433ab57a9828b7f1 | [
"MIT"
] | null | null | null | '''
Desenvolva um programa que leia o primeiro termo e a razão de uma PA. No final, mostre os 10 primeiros termos dessa progressão.
'''
# Ler o primeiro ter a razão
pt = int(input('Digite o primeiro termo: '))
r = int(input('Digite a razão: '))
contador = 0
for i in range(pt, 100, r):
contador = contador + 1
... | 28.133333 | 131 | 0.609005 |
pt = int(input('Digite o primeiro termo: '))
r = int(input('Digite a razão: '))
contador = 0
for i in range(pt, 100, r):
contador = contador + 1
if contador <= 10:
print('-> ', end='')
print(i, end=' ')
print('Acabou!')
| true | true |
1c3be83003f778c4fba3d9bd23fc303426032508 | 7,633 | py | Python | dvc/command/plots.py | vladkol/dvc | f4349aa09b839687fbb24913ee222b815f875567 | [
"Apache-2.0"
] | null | null | null | dvc/command/plots.py | vladkol/dvc | f4349aa09b839687fbb24913ee222b815f875567 | [
"Apache-2.0"
] | null | null | null | dvc/command/plots.py | vladkol/dvc | f4349aa09b839687fbb24913ee222b815f875567 | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import os
from dvc.command import completion
from dvc.command.base import CmdBase, append_doc_link, fix_subparsers
from dvc.exceptions import DvcException
from dvc.schema import PLOT_PROPS
from dvc.utils import format_link
logger = logging.getLogger(__name__)
PAGE_HTML = """<!DOCTYPE h... | 30.16996 | 78 | 0.609852 | import argparse
import logging
import os
from dvc.command import completion
from dvc.command.base import CmdBase, append_doc_link, fix_subparsers
from dvc.exceptions import DvcException
from dvc.schema import PLOT_PROPS
from dvc.utils import format_link
logger = logging.getLogger(__name__)
PAGE_HTML = """<!DOCTYPE h... | true | true |
1c3be867a5388ae3bb6f6bf6154f4631ad868c77 | 28 | py | Python | engine/cameras/__init__.py | LloydTao/ecm3423-fur-effect | fefa73665b459dfd1648dca97a95e8313cf53dd5 | [
"MIT"
] | null | null | null | engine/cameras/__init__.py | LloydTao/ecm3423-fur-effect | fefa73665b459dfd1648dca97a95e8313cf53dd5 | [
"MIT"
] | null | null | null | engine/cameras/__init__.py | LloydTao/ecm3423-fur-effect | fefa73665b459dfd1648dca97a95e8313cf53dd5 | [
"MIT"
] | null | null | null | from .cameras import Camera
| 14 | 27 | 0.821429 | from .cameras import Camera
| true | true |
1c3be89d56f6833f2636d1812cadda82dcdc0286 | 6,931 | py | Python | main.py | dasiusp/DasiToolsBot | 85d5e6c8a19f118b7926420abc236825d890068f | [
"MIT"
] | null | null | null | main.py | dasiusp/DasiToolsBot | 85d5e6c8a19f118b7926420abc236825d890068f | [
"MIT"
] | null | null | null | main.py | dasiusp/DasiToolsBot | 85d5e6c8a19f118b7926420abc236825d890068f | [
"MIT"
] | 1 | 2020-08-29T02:32:13.000Z | 2020-08-29T02:32:13.000Z | import os
import database
from telegram import Update, Bot
from telegram.ext import Dispatcher, CommandHandler, MessageHandler, Filters
from datetime import date
allowed = False
group_id_name = {
"-1001375094289": "Diretoria",
"-1001288984466": "Administrativo",
"-1001479427906": "Financeiro",
"-1001... | 33.645631 | 144 | 0.660799 | import os
import database
from telegram import Update, Bot
from telegram.ext import Dispatcher, CommandHandler, MessageHandler, Filters
from datetime import date
allowed = False
group_id_name = {
"-1001375094289": "Diretoria",
"-1001288984466": "Administrativo",
"-1001479427906": "Financeiro",
"-1001... | true | true |
1c3be8b41689875374e3f616c589eefd510a8e3f | 2,893 | py | Python | venv/lib/python2.7/site-packages/Halberd/reportlib.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | 3 | 2019-04-09T22:59:33.000Z | 2019-06-14T09:23:24.000Z | venv/lib/python2.7/site-packages/Halberd/reportlib.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/Halberd/reportlib.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | null | null | null | # -*- coding: iso-8859-1 -*-
"""Output module.
"""
# Copyright (C) 2004, 2005, 2006, 2010 Juan M. Bello Rivas <jmbr@superadditive.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either... | 31.445652 | 84 | 0.596613 |
import sys
import Halberd.logger
import Halberd.clues.analysis as analysis
def report(scantask):
if scantask.out:
out = open(scantask.out, 'a')
else:
out = sys.stdout
clues = scantask.analyzed
hits = analysis.hits(clues)
logger = Halberd.logger.getLogger()
... | true | true |
1c3be9a3ab654e77f2f050513e77f951170d63da | 7,680 | py | Python | docs/conf.py | astaxie/tsuru | e59ef9621742b236903db080379e04d881896f76 | [
"BSD-3-Clause"
] | 1 | 2015-04-16T15:06:18.000Z | 2015-04-16T15:06:18.000Z | docs/conf.py | astaxie/tsuru | e59ef9621742b236903db080379e04d881896f76 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | astaxie/tsuru | e59ef9621742b236903db080379e04d881896f76 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# tsuru documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 8 11:09:54 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | 31.86722 | 80 | 0.713151 |
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'tsuru'
copyright = u'2012, Globo.com'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
# ... | true | true |
1c3bea03b7204ffb3e1292fb83c45288f17d8e2a | 651 | py | Python | .mm/project.py | avalentino/pyre | 7e1f0287eb7eba1c6d1ef385e5160079283ac363 | [
"BSD-3-Clause"
] | 25 | 2018-04-23T01:45:39.000Z | 2021-12-10T06:01:23.000Z | .mm/project.py | avalentino/pyre | 7e1f0287eb7eba1c6d1ef385e5160079283ac363 | [
"BSD-3-Clause"
] | 53 | 2018-05-31T04:55:00.000Z | 2021-10-07T21:41:32.000Z | .mm/project.py | avalentino/pyre | 7e1f0287eb7eba1c6d1ef385e5160079283ac363 | [
"BSD-3-Clause"
] | 12 | 2018-04-23T22:50:40.000Z | 2022-02-20T17:27:23.000Z | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# california institute of technology
# (c) 1998-2021 all rights reserved
#
def requirements(package):
"""
Build a dictionary with the external dependencies of the {pyre} project
"""
# build the package instances
packages = [
package(name='c... | 23.25 | 75 | 0.634409 |
def requirements(package):
packages = [
package(name='cuda', optional=True),
package(name='gsl', optional=True),
package(name='libpq', optional=True),
package(name='mpi', optional=True),
package(name='python', optional=False),
]
return { packag... | true | true |
1c3bea2ca6cf6637fb72329a95eab934bf988cb6 | 507 | py | Python | env/lib/python3.8/site-packages/plotly/validators/layout/ternary/aaxis/tickfont/_size.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/ternary/aaxis/tickfont/_size.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/ternary/aaxis/tickfont/_size.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="layout.ternary.aaxis.tickfont", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | 31.6875 | 87 | 0.621302 | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="layout.ternary.aaxis.tickfont", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | true | true |
1c3bea465ccf1b418cfcb4ed7a32c6a962440a8b | 1,920 | py | Python | Scripts/Miscellaneous/Automatic Birthday Wisher/main.py | ShivangiPatel102/Python_and_the_Web | 6d3b55aef20feeda3cfff941d7bbdc26cbcc70d2 | [
"MIT"
] | 437 | 2020-09-24T13:57:39.000Z | 2022-03-30T12:45:56.000Z | Scripts/Miscellaneous/Automatic Birthday Wisher/main.py | ShivangiPatel102/Python_and_the_Web | 6d3b55aef20feeda3cfff941d7bbdc26cbcc70d2 | [
"MIT"
] | 355 | 2020-09-24T13:53:16.000Z | 2022-03-27T04:20:40.000Z | Scripts/Miscellaneous/Automatic Birthday Wisher/main.py | ShivangiPatel102/Python_and_the_Web | 6d3b55aef20feeda3cfff941d7bbdc26cbcc70d2 | [
"MIT"
] | 315 | 2020-09-24T18:41:19.000Z | 2022-03-07T05:53:01.000Z | # import required packages
import pandas as pd
import datetime
import smtplib
# your gmail credentials here
GMAIL_ID = "Your-Gmail-Id"
GMAIL_PWD = "Your-Gmail-Password"
# function for sending email
def sendEmail(to, sub, msg):
# conncection to gmail
gmail_obj = smtplib.SMTP("smtp.gmail.com", 587)
# starti... | 33.103448 | 76 | 0.633333 |
import pandas as pd
import datetime
import smtplib
GMAIL_ID = "Your-Gmail-Id"
GMAIL_PWD = "Your-Gmail-Password"
def sendEmail(to, sub, msg):
gmail_obj = smtplib.SMTP("smtp.gmail.com", 587)
gmail_obj.starttls()
gmail_obj.login(GMAIL_ID, GMAIL_PWD)
gmail_obj.sendmail(GMAIL_ID, to,... | true | true |
1c3bea957a4a421963e8b4a878976550483bf762 | 1,602 | py | Python | Sketches/JMB/DescartesTCTest/Wsgi/Apps/simple_app.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/JMB/DescartesTCTest/Wsgi/Apps/simple_app.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/JMB/DescartesTCTest/Wsgi/Apps/simple_app.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | 40.05 | 78 | 0.684145 |
def simple_app(environ, start_response):
"""Simplest possible application object"""
status = '200 OK'
response_headers = [('Content-type','text/html'),('Pragma','no-cache')]
write = start_response(status, response_headers)
print 'start_response called!\n'
writable = environ['ws... | false | true |
1c3beb7ba9f14915689bdfcdc1df88061029b323 | 3,957 | py | Python | src/problem2.py | kreftrl/08-Exam1-201920 | e129f87dc43e8432741340a137da58851a94da6c | [
"MIT"
] | null | null | null | src/problem2.py | kreftrl/08-Exam1-201920 | e129f87dc43e8432741340a137da58851a94da6c | [
"MIT"
] | null | null | null | src/problem2.py | kreftrl/08-Exam1-201920 | e129f87dc43e8432741340a137da58851a94da6c | [
"MIT"
] | null | null | null | """
Exam 1, problem 2.
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Mark Hays, Amanda Stouder, Aaron Wilkin, their colleagues,
and Robert Kreft.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
def main():
""" Calls the TEST functions in this module. """
test_facto... | 35.648649 | 79 | 0.481425 |
def main():
test_factor_sum()
def test_factor_sum():
| true | true |
1c3bec99c0a4743386bda3a0b5ce0d83658fb9f0 | 12,378 | py | Python | ipyvolume/test_all.py | mpu-creare/ipyvolume | ad7eca3a994fad9532a0c3eb52223c10eb4ee586 | [
"MIT"
] | 1 | 2019-04-09T11:57:07.000Z | 2019-04-09T11:57:07.000Z | ipyvolume/test_all.py | mpu-creare/ipyvolume | ad7eca3a994fad9532a0c3eb52223c10eb4ee586 | [
"MIT"
] | null | null | null | ipyvolume/test_all.py | mpu-creare/ipyvolume | ad7eca3a994fad9532a0c3eb52223c10eb4ee586 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import ipyvolume
import ipyvolume.pylab as p3
import ipyvolume as ipv
import ipyvolume.examples
import ipyvolume.datasets
import ipyvolume.utils
import ipyvolume.serialize
import numpy as np
import os
import shutil
import json
import pytest
# helpful to remove previous test resu... | 31.738462 | 128 | 0.643319 | from __future__ import absolute_import
import ipyvolume
import ipyvolume.pylab as p3
import ipyvolume as ipv
import ipyvolume.examples
import ipyvolume.datasets
import ipyvolume.utils
import ipyvolume.serialize
import numpy as np
import os
import shutil
import json
import pytest
if os.path.exists("tmp"):
shutil.... | true | true |
1c3bedacada37c95d091c6a8334c1be97cfb7e13 | 17,268 | py | Python | hw3/dqn.py | yongjin-shin/homework | 0ec67386066be1b1499565d715b6b99dd39954e9 | [
"MIT"
] | null | null | null | hw3/dqn.py | yongjin-shin/homework | 0ec67386066be1b1499565d715b6b99dd39954e9 | [
"MIT"
] | null | null | null | hw3/dqn.py | yongjin-shin/homework | 0ec67386066be1b1499565d715b6b99dd39954e9 | [
"MIT"
] | null | null | null | import uuid
import time
import pickle
import sys
import gym.spaces
import itertools
import numpy as np
import random
import tensorflow as tf
import tensorflow.contrib.layers as layers
from collections import namedtuple
from dqn_utils import *
OptimizerSpec = namedtuple("OptimizerSpec", ["constructor", "kwargs", "lr_sc... | 46.171123 | 119 | 0.638754 | import uuid
import time
import pickle
import sys
import gym.spaces
import itertools
import numpy as np
import random
import tensorflow as tf
import tensorflow.contrib.layers as layers
from collections import namedtuple
from dqn_utils import *
OptimizerSpec = namedtuple("OptimizerSpec", ["constructor", "kwargs", "lr_sc... | true | true |
1c3bedecfccec658a967c782be6d79ce827e2444 | 968 | py | Python | nr_oai_pmh_harvester/rules/nusl/field04107.py | Narodni-repozitar/oai-pmh-harvester | 6703f925c404d72385e070445eb5f8af330384d3 | [
"MIT"
] | null | null | null | nr_oai_pmh_harvester/rules/nusl/field04107.py | Narodni-repozitar/oai-pmh-harvester | 6703f925c404d72385e070445eb5f8af330384d3 | [
"MIT"
] | 2 | 2021-01-04T11:40:37.000Z | 2021-02-08T12:31:05.000Z | nr_oai_pmh_harvester/rules/nusl/field04107.py | Narodni-repozitar/nr-oai-pmh-harvester | b8c6d76325485fc506a31a94b5533d80cdd04596 | [
"MIT"
] | null | null | null | from oarepo_oai_pmh_harvester.decorators import rule
from oarepo_taxonomies.utils import get_taxonomy_json
from sqlalchemy.orm.exc import NoResultFound
@rule("nusl", "marcxml", "/04107", phase="pre")
def call_language(el, **kwargs):
return language(el, **kwargs) # pragma: no cover
def language(el, **kwargs):
... | 25.473684 | 81 | 0.659091 | from oarepo_oai_pmh_harvester.decorators import rule
from oarepo_taxonomies.utils import get_taxonomy_json
from sqlalchemy.orm.exc import NoResultFound
@rule("nusl", "marcxml", "/04107", phase="pre")
def call_language(el, **kwargs):
return language(el, **kwargs)
def language(el, **kwargs):
data = []
i... | true | true |
1c3beed2175dc230717fc152b35333489f67cfd6 | 9,366 | py | Python | pydft/geometry.py | rosenbrockc/dft | 39193cc4c4ac6b151b7ee98f34adb609e412acb4 | [
"MIT"
] | 6 | 2017-10-26T07:56:45.000Z | 2019-01-17T06:39:33.000Z | pydft/geometry.py | rosenbrockc/dft | 39193cc4c4ac6b151b7ee98f34adb609e412acb4 | [
"MIT"
] | null | null | null | pydft/geometry.py | rosenbrockc/dft | 39193cc4c4ac6b151b7ee98f34adb609e412acb4 | [
"MIT"
] | 2 | 2021-11-30T02:33:54.000Z | 2022-02-14T12:46:04.000Z | """Methods and classes for storing and manipulating the global
geometry of the physical problem.
"""
import numpy as np
from pydft.base import testmode
cell = None
"""Cell: default geometry to use globally throughout the code when no other
geometry is explicitly specified.
"""
def get_cell(cell_=None):
"""Returns t... | 33.690647 | 87 | 0.550822 | import numpy as np
from pydft.base import testmode
cell = None
def get_cell(cell_=None):
if cell_ is not None:
return cell_
else:
return cell
def set_cell(cell_):
from pydft.bases.fourier import reset_cache
reset_cache()
global cell
cell = cell_
def set_geometry(R, S, X=Non... | true | true |
1c3bef64e7ed23c10aae0d0abccd862a01b032ac | 10,053 | py | Python | tests/test_compare_tools.py | egor43/PyImageComparsion | 5270f5646c40391cc5ac225305d7be9b0b7de140 | [
"BSD-2-Clause"
] | null | null | null | tests/test_compare_tools.py | egor43/PyImageComparsion | 5270f5646c40391cc5ac225305d7be9b0b7de140 | [
"BSD-2-Clause"
] | null | null | null | tests/test_compare_tools.py | egor43/PyImageComparsion | 5270f5646c40391cc5ac225305d7be9b0b7de140 | [
"BSD-2-Clause"
] | null | null | null | """
Модуль содержит юнит-тесты инструментов модуля compare_tools
author: https://github.com/egor43
"""
import unittest
from image_comparsion import image_opener
from image_comparsion import image_metrick
from image_comparsion import compare_tools
class TestCompareTools(unittest.TestCase):
"""
На... | 42.961538 | 122 | 0.685666 |
import unittest
from image_comparsion import image_opener
from image_comparsion import image_metrick
from image_comparsion import compare_tools
class TestCompareTools(unittest.TestCase):
def setUp(self):
self.img1_path = "./tests/files/1.png"
with open(self.img1_path, "rb") as image_bs:
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.