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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f762a6b092e642cc439a912698652965d86aa088 | 2,259 | py | Python | models/tf_server.py | KleinYuan/tf-tailor | 70e85643a49ad4484ef856c22a0de2ae8a5a00e9 | [
"MIT"
] | 16 | 2018-12-25T16:38:08.000Z | 2020-07-21T05:13:16.000Z | models/tf_server.py | KleinYuan/tf-tailor | 70e85643a49ad4484ef856c22a0de2ae8a5a00e9 | [
"MIT"
] | null | null | null | models/tf_server.py | KleinYuan/tf-tailor | 70e85643a49ad4484ef856c22a0de2ae8a5a00e9 | [
"MIT"
] | 1 | 2020-05-04T01:35:10.000Z | 2020-05-04T01:35:10.000Z | import tensorflow as tf
class TFServer(object):
def __init__(self, config):
tf.reset_default_graph()
self.in_progress = False
self.prediction = None
self.session = None
self.graph = None
self.frozen = False
self.feed_dict = {}
self.output_ops = []
self.input_ops = []
self.model_fp = config.model... | 29.337662 | 118 | 0.737494 | import tensorflow as tf
class TFServer(object):
def __init__(self, config):
tf.reset_default_graph()
self.in_progress = False
self.prediction = None
self.session = None
self.graph = None
self.frozen = False
self.feed_dict = {}
self.output_ops = []
self.input_ops = []
self.model_fp = config.model... | true | true |
f762a722f2fd7100e80e5e24428897348d6eaef5 | 11,430 | py | Python | homeassistant/components/doorbird/__init__.py | unverbraucht/core | 312af53935a1bffd58b3b35e82e31292a6ec22ad | [
"Apache-2.0"
] | 2 | 2019-11-20T20:56:59.000Z | 2021-01-03T08:52:18.000Z | homeassistant/components/doorbird/__init__.py | shownor/core | b50281a9173e7fb4a37b3f813ca92876088eaac3 | [
"Apache-2.0"
] | 5 | 2020-04-26T10:50:01.000Z | 2021-03-16T21:19:46.000Z | homeassistant/components/doorbird/__init__.py | winterscar/core | 5a55d508791aae65f16396691d014c73fb2095f0 | [
"Apache-2.0"
] | 1 | 2021-04-18T19:36:34.000Z | 2021-04-18T19:36:34.000Z | """Support for DoorBird devices."""
import asyncio
import logging
import urllib
from urllib.error import HTTPError
from doorbirdpy import DoorBird
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.logbook import log_entry
from homeassistant.config_entri... | 30.808625 | 88 | 0.651269 | import asyncio
import logging
import urllib
from urllib.error import HTTPError
from doorbirdpy import DoorBird
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.logbook import log_entry
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry... | true | true |
f762a89cd266e9ffd34a00c4bc38e99e50c44f24 | 5,609 | py | Python | docs/source/conf.py | yaolu/transformers | d5dd44ef1b88d50cd85304ba8a7843729f2872f9 | [
"Apache-2.0"
] | 2 | 2019-10-29T12:48:58.000Z | 2019-11-30T02:58:39.000Z | docs/source/conf.py | YifeiYang210/transformers | eb7efa49ea0dec194d4be4e2937d99f74d191d5a | [
"Apache-2.0"
] | 9 | 2020-09-25T20:49:41.000Z | 2022-02-10T00:32:07.000Z | docs/source/conf.py | fakerbrother/PyTorchBertClone | cc7968227e08858df4a5c618c739e1a3ca050196 | [
"Apache-2.0"
] | 1 | 2020-08-01T14:55:14.000Z | 2020-08-01T14:55:14.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 29.677249 | 79 | 0.652344 |
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
project = u'transformers'
copyright = u'2019, huggingface'
author = u'huggingface'
version = u''
release = u'2.2.0'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
'recommonmark',
'sphinx.e... | true | true |
f762a8cd946c590983c5a7e228fb8a3634b91dcb | 126,959 | py | Python | mrcnn/model.py | RajaSudalai/Motorcyclist_Helmet_Detection | 5f739115ed1453ce01a51204219abe080e159761 | [
"MIT"
] | 1 | 2022-02-10T06:57:04.000Z | 2022-02-10T06:57:04.000Z | mrcnn/model.py | RajaSudalai/Motorcyclist_Helmet_Detection | 5f739115ed1453ce01a51204219abe080e159761 | [
"MIT"
] | null | null | null | mrcnn/model.py | RajaSudalai/Motorcyclist_Helmet_Detection | 5f739115ed1453ce01a51204219abe080e159761 | [
"MIT"
] | null | null | null | """
Mask R-CNN
The main Mask R-CNN model implementation.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
"""
import os
import random
import datetime
import re
import math
import logging
from collections import OrderedDict
import multiprocessing
im... | 44.236585 | 115 | 0.612064 |
import os
import random
import datetime
import re
import math
import logging
from collections import OrderedDict
import multiprocessing
import numpy as np
import tensorflow as tf
import keras
import keras.backend as K
import keras.layers as KL
import keras.engine as KE
import keras.models as KM
from mrcnn import util... | true | true |
f762a9085ced60cc1e24a9d4a1b596fc9cfacebf | 4,550 | py | Python | rest_framework_mongoengine/tests/test_serializers.py | shinSG/django-rest-framework-mongoengine | 8d64fd1f917f1333c0026120b1955ae81eacba07 | [
"MIT"
] | null | null | null | rest_framework_mongoengine/tests/test_serializers.py | shinSG/django-rest-framework-mongoengine | 8d64fd1f917f1333c0026120b1955ae81eacba07 | [
"MIT"
] | null | null | null | rest_framework_mongoengine/tests/test_serializers.py | shinSG/django-rest-framework-mongoengine | 8d64fd1f917f1333c0026120b1955ae81eacba07 | [
"MIT"
] | null | null | null | from datetime import datetime
import mongoengine as me
from unittest import TestCase
from bson import objectid
from rest_framework_mongoengine.serializers import DocumentSerializer
from rest_framework import serializers as s
class Job(me.Document):
title = me.StringField()
status = me.StringField(choices=(... | 29.738562 | 88 | 0.638242 | from datetime import datetime
import mongoengine as me
from unittest import TestCase
from bson import objectid
from rest_framework_mongoengine.serializers import DocumentSerializer
from rest_framework import serializers as s
class Job(me.Document):
title = me.StringField()
status = me.StringField(choices=(... | false | true |
f762a9580fa3d5dde38fe1b137bb6e6574341e58 | 1,124 | py | Python | TextCNN.py | leo6033/Graduation-Project | c1cf68edaffc346b37ac6e615d580cd05c4f0711 | [
"MIT"
] | 1 | 2021-09-30T01:16:11.000Z | 2021-09-30T01:16:11.000Z | TextCNN.py | leo6033/Graduation-Project | c1cf68edaffc346b37ac6e615d580cd05c4f0711 | [
"MIT"
] | null | null | null | TextCNN.py | leo6033/Graduation-Project | c1cf68edaffc346b37ac6e615d580cd05c4f0711 | [
"MIT"
] | 1 | 2021-09-30T01:16:13.000Z | 2021-09-30T01:16:13.000Z | """
@Description: TextCNN 网络
@Author: 吕明伟
@Date: 2021-4-6
"""
from tensorflow.keras import Input, Model
from tensorflow.keras.layers import Embedding, Dense, Conv1D, GlobalMaxPooling1D, Concatenate, Dropout
class TextCNN(object):
def __init__(self, maxlen, max_features, embedding_dims,
class_num=5... | 36.258065 | 118 | 0.653025 | from tensorflow.keras import Input, Model
from tensorflow.keras.layers import Embedding, Dense, Conv1D, GlobalMaxPooling1D, Concatenate, Dropout
class TextCNN(object):
def __init__(self, maxlen, max_features, embedding_dims,
class_num=5,
last_activation='softmax'):
self.ma... | true | true |
f762a9f0d8a0c403f23fff27fbbd48d17375c793 | 62,612 | py | Python | external/ssf/ssfinfo/ssfinfo.py | larrykoubiak/vgmtoolbox | 62423a63aa2a24cdf1bb4fc14414b73842c17603 | [
"MIT"
] | 24 | 2017-12-17T06:40:13.000Z | 2022-03-29T00:52:34.000Z | external/ssf/ssfinfo/ssfinfo.py | Gteditor99/vgmtoolbox | 62423a63aa2a24cdf1bb4fc14414b73842c17603 | [
"MIT"
] | null | null | null | external/ssf/ssfinfo/ssfinfo.py | Gteditor99/vgmtoolbox | 62423a63aa2a24cdf1bb4fc14414b73842c17603 | [
"MIT"
] | 5 | 2019-04-29T07:33:17.000Z | 2021-08-15T03:18:36.000Z | #=====================================================================================================
# SSF/miniSSF info generator v0.09 (2007-12-20) by kingshriek
# Command-line interface script that analyzes SSF/miniSSF files - useful for troubleshooting
# Example uses:
# - checking if sequence data references ... | 46.551673 | 215 | 0.507315 |
import os
import sys
import zlib
from struct import *
from array import *
from glob import *
class mpro:
def __init__(self,data):
self.TRA = (data >> 56) & 0x7F
self.TWT = (data >> 55) & 0x1
self.TWA = (data >> 48) & 0x7F
self.XSEL = (data >> 47) & 0x1
self.YSEL = (data >> 45) & 0x3
self.IRA =... | false | true |
f762aa32a6ce0818b4c5f8facdd1d385f642b4dd | 1,563 | py | Python | setup.py | fitoprincipe/geepillow | 5f42585881a117a09d3ccfc00e253b51cde03b06 | [
"MIT"
] | 4 | 2020-05-01T14:17:59.000Z | 2021-10-09T01:58:37.000Z | setup.py | fitoprincipe/geepillow | 5f42585881a117a09d3ccfc00e253b51cde03b06 | [
"MIT"
] | null | null | null | setup.py | fitoprincipe/geepillow | 5f42585881a117a09d3ccfc00e253b51cde03b06 | [
"MIT"
] | 1 | 2021-10-09T01:58:40.000Z | 2021-10-09T01:58:40.000Z | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
here = os.path.dirname(os.path.abspath(__file__))
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to... | 31.897959 | 79 | 0.59373 |
import os
from setuptools import setup, find_packages
here = os.path.dirname(os.path.abspath(__file__))
# README file and 2) it's easier to type in the README file than to put a raw
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
version_ns = {}
with open(os.path.join(here, '... | true | true |
f762aa8d2ee2deac064c6547ce3774491e0514b8 | 8,239 | py | Python | qa/rpc-tests/test_framework/test_framework.py | krisalpha/tushcoin | da6f4b23cae5852038669e48e9a4f188d97fe29f | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/test_framework.py | krisalpha/tushcoin | da6f4b23cae5852038669e48e9a4f188d97fe29f | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/test_framework.py | krisalpha/tushcoin | da6f4b23cae5852038669e48e9a4f188d97fe29f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Base class for RPC testing
import logging
import optparse
import os
import sys
import shutil
import te... | 37.45 | 142 | 0.610632 |
import logging
import optparse
import os
import sys
import shutil
import tempfile
import traceback
from .util import (
initialize_chain,
start_nodes,
connect_nodes_bi,
sync_blocks,
sync_mempools,
stop_nodes,
stop_node,
enable_coverage,
check_json_precision,
initialize_chain_cl... | true | true |
f762abcb5f3640582a71afd557575c64b0c05efa | 827 | py | Python | utils/tl_check_fw.py | unaiur/ATC_MiThermometer | 086eeab85caf2b53857f4d050e8ef0bf81abbe61 | [
"MIT-0"
] | 2 | 2022-02-09T20:19:46.000Z | 2022-02-09T21:34:46.000Z | utils/tl_check_fw.py | jaggil/ATC_MiThermometer | 3779bafbeb4c94e86ca2452e4d6ba6c06ff0b13c | [
"MIT-0"
] | null | null | null | utils/tl_check_fw.py | jaggil/ATC_MiThermometer | 3779bafbeb4c94e86ca2452e4d6ba6c06ff0b13c | [
"MIT-0"
] | null | null | null | #! /usr/bin/env python3
import binascii
import sys
# https://github.com/pvvx/ATC_MiThermometer/issues/186#issuecomment-1030410603
with open(sys.argv[1], 'rb') as f:
firmware = bytearray(f.read(-1))
if firmware[6:8] != b'\x5d\x02':
# Ensure FW size is multiple of 16
padding = 16 - len(firmware) % 16
if ... | 33.08 | 78 | 0.649335 | import binascii
import sys
with open(sys.argv[1], 'rb') as f:
firmware = bytearray(f.read(-1))
if firmware[6:8] != b'\x5d\x02':
padding = 16 - len(firmware) % 16
if padding < 16:
firmware += b'\xFF' * padding
firmware[0x18:0x1c] = (len(firmware)+4).to_bytes(4, byteorder='little')
... | true | true |
f762abdb437ed1ac2fda348bd5c0782a9d7e0b42 | 5,786 | py | Python | apps/alerts/api.py | Cal-CS-61A-Staff/examtool-web | c31b8596fde75c54fe6436400bb6d2889d7b1283 | [
"MIT"
] | 1 | 2020-05-06T22:34:44.000Z | 2020-05-06T22:34:44.000Z | apps/alerts/api.py | Cal-CS-61A-Staff/examtool-web | c31b8596fde75c54fe6436400bb6d2889d7b1283 | [
"MIT"
] | 5 | 2020-07-13T09:29:01.000Z | 2020-10-18T06:33:30.000Z | apps/alerts/api.py | Cal-CS-61A-Staff/examtool-web | c31b8596fde75c54fe6436400bb6d2889d7b1283 | [
"MIT"
] | 5 | 2020-05-13T16:10:24.000Z | 2020-09-23T18:41:06.000Z | import base64
import time
from os import getenv
from typing import TYPE_CHECKING
from google.cloud import texttospeech
import requests
from flask import abort
if TYPE_CHECKING:
from google.cloud import firestore
BATCH_SIZE = 400
assert BATCH_SIZE < 500
def get_email_from_secret(secret):
ret = requests.get(... | 29.370558 | 106 | 0.563083 | import base64
import time
from os import getenv
from typing import TYPE_CHECKING
from google.cloud import texttospeech
import requests
from flask import abort
if TYPE_CHECKING:
from google.cloud import firestore
BATCH_SIZE = 400
assert BATCH_SIZE < 500
def get_email_from_secret(secret):
ret = requests.get(... | true | true |
f762ac46479087acc1fc314fcda0d18ab3d777f9 | 1,750 | py | Python | tests/rzyss/rzyss.py | plewis/phycas | 9f5a4d9b2342dab907d14a46eb91f92ad80a5605 | [
"MIT"
] | 3 | 2015-09-24T23:12:57.000Z | 2021-04-12T07:07:01.000Z | tests/rzyss/rzyss.py | plewis/phycas | 9f5a4d9b2342dab907d14a46eb91f92ad80a5605 | [
"MIT"
] | null | null | null | tests/rzyss/rzyss.py | plewis/phycas | 9f5a4d9b2342dab907d14a46eb91f92ad80a5605 | [
"MIT"
] | 1 | 2015-11-23T10:35:43.000Z | 2015-11-23T10:35:43.000Z | # This file does a short MCMC analysis under the GTR+I+G model
from phycas import *
filename = getPhycasTestData('green.nex')
blob = readFile(filename)
setMasterSeed(13579)
model.type = 'hky'
model.num_rates = 1
model.pinvar_model = False
model.kappa_prior = BetaPrime(1.0, 1.0)
model.state_freq_prior = Dirichlet((1... | 25.362319 | 277 | 0.745143 |
from phycas import *
filename = getPhycasTestData('green.nex')
blob = readFile(filename)
setMasterSeed(13579)
model.type = 'hky'
model.num_rates = 1
model.pinvar_model = False
model.kappa_prior = BetaPrime(1.0, 1.0)
model.state_freq_prior = Dirichlet((1.0, 1.0, 1.0, 1.0))
model.edgelen_hyperprior = None
model.tree... | true | true |
f762ac4fd3d586750299b383d636488dc10fe257 | 988 | py | Python | venv/Lib/site-packages/appium/webdriver/common/mobileby.py | zhangxiuqing007/EfUITest | d54c568b3996ef3e732ea335916de61cadc06e84 | [
"MIT"
] | 3 | 2019-09-28T08:22:37.000Z | 2019-09-29T06:23:47.000Z | appium/webdriver/common/mobileby.py | zgq346712481/python-client | 1c179d2c84c76bbed33e6333f381cc8a86f3bb82 | [
"Apache-2.0"
] | 4 | 2021-06-02T00:35:24.000Z | 2022-01-13T01:47:56.000Z | appium/webdriver/common/mobileby.py | zgq346712481/python-client | 1c179d2c84c76bbed33e6333f381cc8a86f3bb82 | [
"Apache-2.0"
] | 1 | 2019-12-04T09:10:18.000Z | 2019-12-04T09:10:18.000Z | #!/usr/bin/env python
# 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... | 35.285714 | 74 | 0.738866 |
from selenium.webdriver.common.by import By
class MobileBy(By):
IOS_PREDICATE = '-ios predicate string'
IOS_UIAUTOMATION = '-ios uiautomation'
IOS_CLASS_CHAIN = '-ios class chain'
ANDROID_UIAUTOMATOR = '-android uiautomator'
ANDROID_VIEWTAG = '-android viewtag'
ANDROID_DATA_MATCHER = '-andro... | true | true |
f762ada7b48546c3940f787da51c4dabfde59b2d | 1,442 | py | Python | kubernetes/test/test_v1beta1_ingress_tls.py | SEJeff/client-python | baba523c28a684b3f537502977d600dedd1f17c5 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1beta1_ingress_tls.py | SEJeff/client-python | baba523c28a684b3f537502977d600dedd1f17c5 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1beta1_ingress_tls.py | SEJeff/client-python | baba523c28a684b3f537502977d600dedd1f17c5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.5.0-beta.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "Lice... | 26.703704 | 105 | 0.725381 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.v1beta1_ingress_tls import V1beta1IngressTLS
class TestV1beta1IngressTLS(unittest.TestCase):
def setUp(self):
pass
de... | true | true |
f762ae52ec8ccb24300de9f487b82b51ac74cb21 | 3,492 | py | Python | RADGIS/preprocessing/knn.py | jtapanes21/RADGIS | 2322f75f23cec4dde9f8c7b21d9137f1986e6382 | [
"MIT"
] | null | null | null | RADGIS/preprocessing/knn.py | jtapanes21/RADGIS | 2322f75f23cec4dde9f8c7b21d9137f1986e6382 | [
"MIT"
] | null | null | null | RADGIS/preprocessing/knn.py | jtapanes21/RADGIS | 2322f75f23cec4dde9f8c7b21d9137f1986e6382 | [
"MIT"
] | null | null | null | from sklearn.neighbors import BallTree
import numpy as np
'''
Returns the KNN and distance in meters to the KNN.
Parameters
----------
left_gdf : GeoDataFrame
the target geodataframe; all columns are kept.
right_gdf : GeoDataFrame
the geodataframe that is the subject of the measuremen... | 33.576923 | 166 | 0.706758 | from sklearn.neighbors import BallTree
import numpy as np
def _get_nearest(src_points, candidates, k_neighbors=1):
tree = BallTree(candidates, leaf_size=15, metric='haversine')
distances, indices = tree.query(src_points, k=k_neighbors)
distances = distances.transpose()
indices = indices... | true | true |
f762ae8f71e8825b27674c8ebb825a979fac2c5a | 7,381 | py | Python | collect_env.py | bianxg/BackgroundMattingV2 | af15097de99564f5042121601abe4050cc2e3c2e | [
"MIT"
] | null | null | null | collect_env.py | bianxg/BackgroundMattingV2 | af15097de99564f5042121601abe4050cc2e3c2e | [
"MIT"
] | null | null | null | collect_env.py | bianxg/BackgroundMattingV2 | af15097de99564f5042121601abe4050cc2e3c2e | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
import importlib
import numpy as np
import os
import re
import subprocess
import sys
from collections import defaultdict
import PIL
import torch
import torchvision
from tabulate import tabulate
__all__ = ["collect_env_info"]
def collect_torch_env():
... | 35.147619 | 97 | 0.562661 | import importlib
import numpy as np
import os
import re
import subprocess
import sys
from collections import defaultdict
import PIL
import torch
import torchvision
from tabulate import tabulate
__all__ = ["collect_env_info"]
def collect_torch_env():
try:
import torch.__config__
... | true | true |
f762af1e22af251fedc3811df152bfb3fc5dd56f | 492 | py | Python | cats/migrations/0004_alter_cat_color.py | tu2gin/kittygram_plus | c753df7c2a6e4cee2947da300fdac6173277c151 | [
"MIT"
] | null | null | null | cats/migrations/0004_alter_cat_color.py | tu2gin/kittygram_plus | c753df7c2a6e4cee2947da300fdac6173277c151 | [
"MIT"
] | null | null | null | cats/migrations/0004_alter_cat_color.py | tu2gin/kittygram_plus | c753df7c2a6e4cee2947da300fdac6173277c151 | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2022-01-27 08:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cats', '0003_auto_20220126_1548'),
]
operations = [
migrations.AlterField(
model_name='cat',
name='color',
... | 25.894737 | 165 | 0.579268 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cats', '0003_auto_20220126_1548'),
]
operations = [
migrations.AlterField(
model_name='cat',
name='color',
field=models.CharField(choices=[('Gray', 'Сер... | true | true |
f762af308560119f4c33a3689b0651d844bfc0d4 | 584 | py | Python | learn/hard-way/ex18.py | hustbill/Python-auto | 9f43bc2613a64a373927047ac52d8e90ffe644f8 | [
"Apache-2.0"
] | null | null | null | learn/hard-way/ex18.py | hustbill/Python-auto | 9f43bc2613a64a373927047ac52d8e90ffe644f8 | [
"Apache-2.0"
] | null | null | null | learn/hard-way/ex18.py | hustbill/Python-auto | 9f43bc2613a64a373927047ac52d8e90ffe644f8 | [
"Apache-2.0"
] | null | null | null | # Ex18.py
# Names, Variables, Code, Functions
#
# this one is like your scripts with argv
def print_two(*args):
arg1, arg2= args
print "arg1: %r, arg2: %r" % (arg1, arg2)
# Ok, that *args is actually pointless, we can just do this
def print_two_again(arg1, arg2):
print "arg1:%r, arg2:%r" % (arg1, ... | 20.137931 | 61 | 0.642123 |
def print_two(*args):
arg1, arg2= args
print "arg1: %r, arg2: %r" % (arg1, arg2)
def print_two_again(arg1, arg2):
print "arg1:%r, arg2:%r" % (arg1, arg2)
def print_one(arg1):
print "arg1: %r" % arg1
def print_none():
print "I got nothin'."
print_two("Zed", "Shaw")
print_two_again("Ze... | false | true |
f762af3de534e9f8860060fa429617a4ca130f51 | 1,161 | py | Python | nasymoe/models/__init__.py | nasyxx/nasy.moe | 957fdba24a3b524025b6b4ae3fe69cc4f703d1c9 | [
"MIT"
] | null | null | null | nasymoe/models/__init__.py | nasyxx/nasy.moe | 957fdba24a3b524025b6b4ae3fe69cc4f703d1c9 | [
"MIT"
] | null | null | null | nasymoe/models/__init__.py | nasyxx/nasy.moe | 957fdba24a3b524025b6b4ae3fe69cc4f703d1c9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Life's pathetic, have fun ("▔□▔)/hi~♡ Nasy.
Excited without bugs::
| * *
| . .
| .
| * ,
| .
|
| *
|... | 29.025 | 68 | 0.44789 | true | true | |
f762b1aa74632a7212a350084213720d8fe78876 | 7,360 | py | Python | test/expected/python.tornado/actual_base/f_BaseFoo.py | matthinrichsen-wf/frugal | 7a28bcc8b4c30baf21c20a8a1e1f0ed367e3d400 | [
"Apache-2.0"
] | null | null | null | test/expected/python.tornado/actual_base/f_BaseFoo.py | matthinrichsen-wf/frugal | 7a28bcc8b4c30baf21c20a8a1e1f0ed367e3d400 | [
"Apache-2.0"
] | null | null | null | test/expected/python.tornado/actual_base/f_BaseFoo.py | matthinrichsen-wf/frugal | 7a28bcc8b4c30baf21c20a8a1e1f0ed367e3d400 | [
"Apache-2.0"
] | null | null | null | #
# Autogenerated by Frugal Compiler (2.23.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from datetime import timedelta
from threading import Lock
from frugal.exceptions import TApplicationExceptionType
from frugal.exceptions import TTransportExceptionType
from frugal.middleware import M... | 31.861472 | 151 | 0.632201 |
from datetime import timedelta
from threading import Lock
from frugal.exceptions import TApplicationExceptionType
from frugal.exceptions import TTransportExceptionType
from frugal.middleware import Method
from frugal.tornado.processor import FBaseProcessor
from frugal.tornado.processor import FProcessorFunction
fro... | true | true |
f762b1b520ce4d833653c7f9ab5920327036e3c8 | 6,102 | py | Python | qa/rpc-tests/proxy_test.py | alannnnn12345/MerkleRO-Core | 52291aef494e5192f5ab7acdcace995a56298fb4 | [
"MIT"
] | 9 | 2018-08-23T19:33:14.000Z | 2019-08-06T13:51:39.000Z | qa/rpc-tests/proxy_test.py | alannnnn12345/MerkleRO-Core | 52291aef494e5192f5ab7acdcace995a56298fb4 | [
"MIT"
] | 4 | 2018-09-19T10:45:01.000Z | 2020-11-16T20:11:19.000Z | qa/rpc-tests/proxy_test.py | alannnnn12345/MerkleRO-Core | 52291aef494e5192f5ab7acdcace995a56298fb4 | [
"MIT"
] | 13 | 2018-08-18T19:45:21.000Z | 2019-10-06T18:51:09.000Z | #!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import socket
import traceback, sys
from binascii import hexlify
import time, os
from socks5 import Socks5Conf... | 41.794521 | 145 | 0.653228 | import socket
import traceback, sys
from binascii import hexlify
import time, os
from socks5 import Socks5Configuration, Socks5Command, Socks5Server, AddressType
from test_framework import BitcoinTestFramework
from util import *
class ProxyTest(BitcoinTestFramework):
def __init__(self):
se... | true | true |
f762b22553dbeb2c16d5627242a7c22af10fdfd6 | 487 | py | Python | scripts/GiteePR_statistics/para.py | iamtwz/tarsier-oerv | b47a0e2dd49265b3e229413c0cc5a4cc5eb9170f | [
"Apache-2.0"
] | 7 | 2022-02-22T03:34:36.000Z | 2022-03-23T08:28:51.000Z | scripts/GiteePR_statistics/para.py | iamtwz/tarsier-oerv | b47a0e2dd49265b3e229413c0cc5a4cc5eb9170f | [
"Apache-2.0"
] | 76 | 2022-02-20T16:12:44.000Z | 2022-03-31T15:39:27.000Z | scripts/GiteePR_statistics/para.py | iamtwz/tarsier-oerv | b47a0e2dd49265b3e229413c0cc5a4cc5eb9170f | [
"Apache-2.0"
] | 24 | 2022-02-20T09:29:26.000Z | 2022-03-27T03:22:00.000Z | import os
token = 'your gitee account token'
period = ['start_date', 'end_date'] # period = ['2022-02-01', '2022-02-24']
sheet1_header = [
'packageName',
'rvPRStatus',
'rvPRUrl',
'rvPRUser',
'created_at'
]
sheet2_header = ['rvPRUser', 'number of PR']
report_header = [sheet1_header, sheet... | 23.190476 | 79 | 0.648871 | import os
token = 'your gitee account token'
period = ['start_date', 'end_date']
sheet1_header = [
'packageName',
'rvPRStatus',
'rvPRUrl',
'rvPRUser',
'created_at'
]
sheet2_header = ['rvPRUser', 'number of PR']
report_header = [sheet1_header, sheet2_header]
headers = {
'Content-Type'... | true | true |
f762b2ec957e48eaf4442f20454355d1523a655c | 1,148 | py | Python | src/challenges/CtCI/arrays/tests/test_P3_compress.py | Ursidours/pythonic_interviews | a88e10b82ed2a163dfcc0bfd1d01a9e9e606c045 | [
"MIT"
] | 2 | 2021-11-13T01:30:25.000Z | 2022-02-11T18:17:22.000Z | src/challenges/CtCI/arrays/tests/test_P3_compress.py | arnaudblois/pythonic_interviews | a88e10b82ed2a163dfcc0bfd1d01a9e9e606c045 | [
"MIT"
] | null | null | null | src/challenges/CtCI/arrays/tests/test_P3_compress.py | arnaudblois/pythonic_interviews | a88e10b82ed2a163dfcc0bfd1d01a9e9e606c045 | [
"MIT"
] | null | null | null | from ..P6_string_compression import compress, uncompress
# Testing the compress function
# --------------------------------
def test_compress_empty():
assert compress('') == ''
def test_compress_one_element():
assert compress('a') == 'a'
def test_compressible_3():
assert compress('aaa') == 'a3'
def... | 21.259259 | 76 | 0.665505 | from ..P6_string_compression import compress, uncompress
def test_compress_empty():
assert compress('') == ''
def test_compress_one_element():
assert compress('a') == 'a'
def test_compressible_3():
assert compress('aaa') == 'a3'
def test_non_compressible_2():
assert compress('aa') == 'aa'
def... | true | true |
f762b324f1c4972948922dd0e285d6016162c9fa | 25,303 | py | Python | qa/rpc-tests/fundrawtransaction.py | CyberSensei1/mogwai | 425e0889c5593189be8c954ab37df4c566e87205 | [
"MIT"
] | 11 | 2018-06-23T09:44:49.000Z | 2021-03-14T20:29:23.000Z | qa/rpc-tests/fundrawtransaction.py | CyberSensei1/mogwai | 425e0889c5593189be8c954ab37df4c566e87205 | [
"MIT"
] | 1 | 2018-06-26T17:00:18.000Z | 2018-06-26T18:10:55.000Z | qa/rpc-tests/fundrawtransaction.py | CyberSensei1/mogwai | 425e0889c5593189be8c954ab37df4c566e87205 | [
"MIT"
] | 12 | 2018-06-26T16:36:01.000Z | 2020-02-10T00:41:16.000Z | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
# Creat... | 40.680064 | 214 | 0.557483 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class RawTransactionsTest(BitcoinTestFramework):
def setup_chain(self):
print("Initializing test directory "+self.options.tmpdir)
initialize_chain_clean(self.options.tmpdir, 4)
def setup_network(... | false | true |
f762b4620051da359b2e9fd700cca1865cd55fee | 547 | py | Python | api/schemas.py | nus-ncl/CTFPro | 76867d0b15db143407f37df3ea44a5662dc16a0c | [
"Apache-2.0"
] | null | null | null | api/schemas.py | nus-ncl/CTFPro | 76867d0b15db143407f37df3ea44a5662dc16a0c | [
"Apache-2.0"
] | 8 | 2021-11-12T09:19:46.000Z | 2021-12-27T07:37:34.000Z | api/schemas.py | nus-ncl/CTFPro | 76867d0b15db143407f37df3ea44a5662dc16a0c | [
"Apache-2.0"
] | 2 | 2021-10-31T11:19:52.000Z | 2021-12-20T08:39:46.000Z | from pydantic import BaseModel
from typing import Optional, List
# TO support creation and update APIs
class CreateAndUpdateComponent(BaseModel):
type: str
hostname: str
URL_access: str
username: str
# TO create components
class Creation(BaseModel):
ctfd: bool
ctfd_type: str
ctfd_... | 20.259259 | 42 | 0.702011 | from pydantic import BaseModel
from typing import Optional, List
class CreateAndUpdateComponent(BaseModel):
type: str
hostname: str
URL_access: str
username: str
class Creation(BaseModel):
ctfd: bool
ctfd_type: str
ctfd_name: str
dashboard: bool
dashboard_type: str
das... | true | true |
f762b4848728312c30889811a84e686f289e8906 | 28,352 | py | Python | python/ray/tune/test/trial_runner_test.py | songqing/ray | 166000b089ee15d44635ebca00f12320f51ce587 | [
"Apache-2.0"
] | 1 | 2018-06-25T08:00:51.000Z | 2018-06-25T08:00:51.000Z | python/ray/tune/test/trial_runner_test.py | songqing/ray | 166000b089ee15d44635ebca00f12320f51ce587 | [
"Apache-2.0"
] | 1 | 2018-01-26T05:11:04.000Z | 2018-01-26T05:11:04.000Z | python/ray/tune/test/trial_runner_test.py | songqing/ray | 166000b089ee15d44635ebca00f12320f51ce587 | [
"Apache-2.0"
] | 1 | 2020-10-16T08:42:32.000Z | 2020-10-16T08:42:32.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import unittest
import ray
from ray.rllib import _register_all
from ray.tune import Trainable, TuneError
from ray.tune import register_env, register_trainable, run_experiments
from ray.t... | 31.156044 | 78 | 0.527899 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import unittest
import ray
from ray.rllib import _register_all
from ray.tune import Trainable, TuneError
from ray.tune import register_env, register_trainable, run_experiments
from ray.t... | true | true |
f762b4942d16e807840d4679c928ff9e109769ed | 5,207 | py | Python | tests/components/bond/test_fan.py | gjbadros/home-assistant | 1a64108eeaeb6f7bdcb3d0a812d7001af7ea5dff | [
"Apache-2.0"
] | null | null | null | tests/components/bond/test_fan.py | gjbadros/home-assistant | 1a64108eeaeb6f7bdcb3d0a812d7001af7ea5dff | [
"Apache-2.0"
] | 38 | 2020-07-23T07:13:12.000Z | 2022-03-31T06:01:47.000Z | tests/components/bond/test_fan.py | gjbadros/home-assistant | 1a64108eeaeb6f7bdcb3d0a812d7001af7ea5dff | [
"Apache-2.0"
] | null | null | null | """Tests for the Bond fan device."""
from datetime import timedelta
from bond import DeviceTypes, Directions
from homeassistant import core
from homeassistant.components import fan
from homeassistant.components.fan import (
ATTR_DIRECTION,
DIRECTION_FORWARD,
DIRECTION_REVERSE,
DOMAIN as FAN_DOMAIN,
... | 36.669014 | 106 | 0.715959 | from datetime import timedelta
from bond import DeviceTypes, Directions
from homeassistant import core
from homeassistant.components import fan
from homeassistant.components.fan import (
ATTR_DIRECTION,
DIRECTION_FORWARD,
DIRECTION_REVERSE,
DOMAIN as FAN_DOMAIN,
SERVICE_SET_DIRECTION,
)
from homea... | true | true |
f762b581f77590f5fa07d0bde9df0dd1f6a48b39 | 3,511 | py | Python | task.py | dishen12/helmet | b1c5626e6cba596252b63a5d90528abc03c94e25 | [
"Apache-2.0"
] | null | null | null | task.py | dishen12/helmet | b1c5626e6cba596252b63a5d90528abc03c94e25 | [
"Apache-2.0"
] | null | null | null | task.py | dishen12/helmet | b1c5626e6cba596252b63a5d90528abc03c94e25 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicabl... | 32.211009 | 132 | 0.706067 |
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | false | true |
f762b5c166138c6326c0b85cbeb593cf118fe187 | 203 | py | Python | tests/Commands/command_bootstrap_test.py | quattrococodrilo/WallpaperAutomata2 | 3639754a3c4ca5a6a673529fa71ed0873b0ff3d8 | [
"MIT"
] | null | null | null | tests/Commands/command_bootstrap_test.py | quattrococodrilo/WallpaperAutomata2 | 3639754a3c4ca5a6a673529fa71ed0873b0ff3d8 | [
"MIT"
] | null | null | null | tests/Commands/command_bootstrap_test.py | quattrococodrilo/WallpaperAutomata2 | 3639754a3c4ca5a6a673529fa71ed0873b0ff3d8 | [
"MIT"
] | null | null | null | import unittest
from WallpaperAutomata.Commands.command_bootstrap import CommandBootstrap
class CommandBootstrapTest(unittest.TestCase):
def test_command(self):
CommandBootstrap.create()
| 20.3 | 73 | 0.807882 | import unittest
from WallpaperAutomata.Commands.command_bootstrap import CommandBootstrap
class CommandBootstrapTest(unittest.TestCase):
def test_command(self):
CommandBootstrap.create()
| true | true |
f762b63f12d9132e9b7ae627d847ed54dbf6ea2e | 1,183 | py | Python | paystack/services/customer_service.py | Nyior/django-rest-paystack | fd74dd26703fe4ce63664736c2063ace7020f71a | [
"MIT"
] | 9 | 2021-12-12T17:59:15.000Z | 2022-02-05T17:13:46.000Z | paystack/services/customer_service.py | Nyior/django-rest-paystack | fd74dd26703fe4ce63664736c2063ace7020f71a | [
"MIT"
] | null | null | null | paystack/services/customer_service.py | Nyior/django-rest-paystack | fd74dd26703fe4ce63664736c2063ace7020f71a | [
"MIT"
] | 1 | 2021-12-21T18:57:03.000Z | 2021-12-21T18:57:03.000Z | from paystack.models import PayStackCustomer
from .base_api_service import BaseAPIService
class CustomerService(BaseAPIService):
def _create_customer_object(self, user, customer_data, authorization_data):
defaults = {
"user": user,
"email": customer_data["email"],
"aut... | 38.16129 | 80 | 0.668639 | from paystack.models import PayStackCustomer
from .base_api_service import BaseAPIService
class CustomerService(BaseAPIService):
def _create_customer_object(self, user, customer_data, authorization_data):
defaults = {
"user": user,
"email": customer_data["email"],
"aut... | true | true |
f762b6ca2dc8e1c295c72d85edfd6138e4207bef | 761 | py | Python | practice/interview_preparation_kit/warm_up_challenges/sales_by_match/sales_by_match.py | vrusinov/hackerrank | 9b927e0f3af027eef91a372b1e5accaac2123e02 | [
"Apache-2.0"
] | null | null | null | practice/interview_preparation_kit/warm_up_challenges/sales_by_match/sales_by_match.py | vrusinov/hackerrank | 9b927e0f3af027eef91a372b1e5accaac2123e02 | [
"Apache-2.0"
] | null | null | null | practice/interview_preparation_kit/warm_up_challenges/sales_by_match/sales_by_match.py | vrusinov/hackerrank | 9b927e0f3af027eef91a372b1e5accaac2123e02 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Sales by Match.
https://www.hackerrank.com/challenges/sock-merchant/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=warmup
"""
import math
import os
import random
import re
import sys
import collections
def sockMerchant(n, ar):
socks_per_color ... | 20.567568 | 148 | 0.674113 |
import math
import os
import random
import re
import sys
import collections
def sockMerchant(n, ar):
socks_per_color = collections.Counter()
for color in ar:
socks_per_color[color] += 1
total_paris = 0
for color, num in socks_per_color.items():
total_paris += num // 2
return total... | true | true |
f762b73ddd318cfa24f17260125228c7c8621849 | 12,065 | py | Python | motpy_edit/tracker.py | ysy9893/object_recognition_with_hand_gesture | fc43211a1e6fe8a19f726f156cf276a8acdcb246 | [
"Apache-2.0"
] | null | null | null | motpy_edit/tracker.py | ysy9893/object_recognition_with_hand_gesture | fc43211a1e6fe8a19f726f156cf276a8acdcb246 | [
"Apache-2.0"
] | null | null | null | motpy_edit/tracker.py | ysy9893/object_recognition_with_hand_gesture | fc43211a1e6fe8a19f726f156cf276a8acdcb246 | [
"Apache-2.0"
] | 1 | 2021-06-26T05:46:03.000Z | 2021-06-26T05:46:03.000Z | import uuid
from collections.abc import Iterable
from typing import Any, Optional, Sequence, Union
import numpy as np
import scipy
from filterpy.kalman import KalmanFilter
from motpy.core import Box, Detection, Track, Vector, setup_logger
from motpy.metrics import angular_similarity, calculate_iou
from motpy.model im... | 35.381232 | 111 | 0.627932 | import uuid
from collections.abc import Iterable
from typing import Any, Optional, Sequence, Union
import numpy as np
import scipy
from filterpy.kalman import KalmanFilter
from motpy.core import Box, Detection, Track, Vector, setup_logger
from motpy.metrics import angular_similarity, calculate_iou
from motpy.model im... | true | true |
f762b779332c74cfef08a59e452ef50b30206984 | 245 | py | Python | metrics/__init__.py | kunheek/style-aware-discriminator | d6ddd7c735d6c162f2a3c942d5cba1e0457f8c39 | [
"MIT"
] | 21 | 2022-03-30T06:58:50.000Z | 2022-03-31T16:38:48.000Z | metrics/__init__.py | kunheek/style-aware-discriminator | d6ddd7c735d6c162f2a3c942d5cba1e0457f8c39 | [
"MIT"
] | null | null | null | metrics/__init__.py | kunheek/style-aware-discriminator | d6ddd7c735d6c162f2a3c942d5cba1e0457f8c39 | [
"MIT"
] | null | null | null | from .fid_evaluator import FIDEvaluator
from .fid_lerp_evaluator import FIDLerpEvaluator
from .knn_evaluator import KNNEvaluator
from .mean_fid_evaluator import MeanFIDEvaluator
from .reconstruction_evaluator import ReconstructionEvaluator
| 40.833333 | 62 | 0.877551 | from .fid_evaluator import FIDEvaluator
from .fid_lerp_evaluator import FIDLerpEvaluator
from .knn_evaluator import KNNEvaluator
from .mean_fid_evaluator import MeanFIDEvaluator
from .reconstruction_evaluator import ReconstructionEvaluator
| true | true |
f762b8a8374510d45316446bcbcd16b4a66d84f7 | 365 | py | Python | Days/Day 5 - How About a Nice Game of Chess/Part 1.py | jamester234/Advent-of-Code-2016 | 104842164435f61d572ea6b6bea78990d2d8896f | [
"MIT"
] | null | null | null | Days/Day 5 - How About a Nice Game of Chess/Part 1.py | jamester234/Advent-of-Code-2016 | 104842164435f61d572ea6b6bea78990d2d8896f | [
"MIT"
] | null | null | null | Days/Day 5 - How About a Nice Game of Chess/Part 1.py | jamester234/Advent-of-Code-2016 | 104842164435f61d572ea6b6bea78990d2d8896f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Dec 26 18:27:13 2017
@author: James Jiang
"""
from hashlib import md5
input = 'ojvtpuvg'
password = ''
counter = 0
while len(password) < 8:
md5_hash = md5((input + str(counter)).encode('utf-8')).hexdigest()
if md5_hash[:5] == '00000':
password += md5_hash[... | 16.590909 | 70 | 0.59726 |
from hashlib import md5
input = 'ojvtpuvg'
password = ''
counter = 0
while len(password) < 8:
md5_hash = md5((input + str(counter)).encode('utf-8')).hexdigest()
if md5_hash[:5] == '00000':
password += md5_hash[5]
counter += 1
print(password)
| true | true |
f762b8eaf221f859392418c51f0c3721500c971c | 2,227 | py | Python | freefolks/wsgi.py | sivaprakashniet/blogger | e02bb99f9f86fddfa5892a7cf387ff73584b00d9 | [
"BSD-3-Clause"
] | null | null | null | freefolks/wsgi.py | sivaprakashniet/blogger | e02bb99f9f86fddfa5892a7cf387ff73584b00d9 | [
"BSD-3-Clause"
] | 2 | 2018-07-22T16:50:42.000Z | 2019-02-20T05:10:06.000Z | freefolks/wsgi.py | sivaprakashniet/blogger | e02bb99f9f86fddfa5892a7cf387ff73584b00d9 | [
"BSD-3-Clause"
] | null | null | null | """
WSGI config for freefolks project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`... | 34.796875 | 79 | 0.745846 | import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__) + "../../")
#site_packages = subprocess.check_output([
# os.path.join(PROJECT_ROOT, '.virtualenv/bin/python'),
# '-c',
# 'from distutils.sysconfig import get_python_lib;'
# ... | true | true |
f762b974892694c280af2311dbd66219c2d42587 | 289 | py | Python | fidetia/noticias/doctype/noticias_web/test_noticias_web.py | Nirchains/fide | 095da135f7685b1ecf7b38d92eaf834ee68be559 | [
"MIT"
] | null | null | null | fidetia/noticias/doctype/noticias_web/test_noticias_web.py | Nirchains/fide | 095da135f7685b1ecf7b38d92eaf834ee68be559 | [
"MIT"
] | null | null | null | fidetia/noticias/doctype/noticias_web/test_noticias_web.py | Nirchains/fide | 095da135f7685b1ecf7b38d92eaf834ee68be559 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Pedro Antonio Fernández Gómez and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Noticias Web')
class TestNoticiasWeb(unittest.TestCase):
pass
| 22.230769 | 68 | 0.778547 | from __future__ import unicode_literals
import frappe
import unittest
class TestNoticiasWeb(unittest.TestCase):
pass
| true | true |
f762bb2ccbecc96593bf0d2d80484ccedd5a1228 | 519 | py | Python | exerc_4_vogal_ou_cons.py | marcelocmedeiros/EstruturaDeDecisao | 33f4ec65e04ba6622f2ca111253fa5ecf7da2091 | [
"MIT"
] | null | null | null | exerc_4_vogal_ou_cons.py | marcelocmedeiros/EstruturaDeDecisao | 33f4ec65e04ba6622f2ca111253fa5ecf7da2091 | [
"MIT"
] | null | null | null | exerc_4_vogal_ou_cons.py | marcelocmedeiros/EstruturaDeDecisao | 33f4ec65e04ba6622f2ca111253fa5ecf7da2091 | [
"MIT"
] | null | null | null | # Marcelo Campos de Medeiros
# ADS UNIFIP
# Lista_2_de_exercicios
# 15/03/2020
'''
4 - Faça um Programa que verifique se uma letra digitada é vogal ou consoante.
'''
#variáveis
letra = str(input('Informe uma letra qualquer: ')).strip().upper()
#comparando se a letra é uma vogal ou uma consoante
if letra == 'A' or le... | 27.315789 | 80 | 0.672447 |
letra = str(input('Informe uma letra qualquer: ')).strip().upper()
if letra == 'A' or letra == 'E' or letra == 'I' or letra == 'O' or letra == 'U':
print(f'A letra digitada foi "{letra}" e ela é uma vogal.')
else:
print(f'A letra digitada foi "{letra}" e ela é uma consoante.')
| true | true |
f762bb5ed2269650042bc99dc592b48b06c29823 | 26,128 | py | Python | pyccl/tracers.py | borisbolliet/CCL | 6ddd35e49f9d2968cef3d3bc1bac8b55dbb4cf91 | [
"BSD-3-Clause"
] | null | null | null | pyccl/tracers.py | borisbolliet/CCL | 6ddd35e49f9d2968cef3d3bc1bac8b55dbb4cf91 | [
"BSD-3-Clause"
] | null | null | null | pyccl/tracers.py | borisbolliet/CCL | 6ddd35e49f9d2968cef3d3bc1bac8b55dbb4cf91 | [
"BSD-3-Clause"
] | null | null | null | from . import ccllib as lib
from .core import check
from .background import comoving_radial_distance, growth_rate, \
growth_factor, scale_factor_of_chi
from .pyutils import _check_array_params, NoneArr
import numpy as np
def get_density_kernel(cosmo, dndz):
"""This convenience function returns the radial kern... | 44.435374 | 78 | 0.577541 | from . import ccllib as lib
from .core import check
from .background import comoving_radial_distance, growth_rate, \
growth_factor, scale_factor_of_chi
from .pyutils import _check_array_params, NoneArr
import numpy as np
def get_density_kernel(cosmo, dndz):
z_n, n = _check_array_params(dndz, 'dndz')
c... | true | true |
f762bc8b7bdc34b93d37c1110113e412763aa68e | 3,095 | py | Python | setup.py | jharris1993/thonny | acc9ee88ebb9eebdfe72c543a39346a5256f53ff | [
"MIT"
] | 1 | 2022-02-09T06:25:31.000Z | 2022-02-09T06:25:31.000Z | setup.py | jharris1993/thonny | acc9ee88ebb9eebdfe72c543a39346a5256f53ff | [
"MIT"
] | null | null | null | setup.py | jharris1993/thonny | acc9ee88ebb9eebdfe72c543a39346a5256f53ff | [
"MIT"
] | null | null | null | import os.path
import sys
from setuptools import find_packages, setup
def recursive_files(directory):
paths = []
for (path, _, filenames) in os.walk(directory):
for filename in filenames:
paths.append(os.path.join('..', path, filename))
return paths
if sys.version_info < (3, 6):
r... | 37.289157 | 138 | 0.61357 | import os.path
import sys
from setuptools import find_packages, setup
def recursive_files(directory):
paths = []
for (path, _, filenames) in os.walk(directory):
for filename in filenames:
paths.append(os.path.join('..', path, filename))
return paths
if sys.version_info < (3, 6):
r... | true | true |
f762bcfc8f452221dc3afffae95c9085b7e1f55e | 5,587 | py | Python | utils.py | wilile26811249/ConvMixer | e3a2bcbedb8e8c2b7b5f942ed0ae55473940d47c | [
"MIT"
] | 42 | 2021-10-07T18:46:03.000Z | 2022-03-30T08:06:43.000Z | utils.py | wilile26811249/ConvMixer | e3a2bcbedb8e8c2b7b5f942ed0ae55473940d47c | [
"MIT"
] | 6 | 2021-10-13T05:24:55.000Z | 2022-03-30T05:46:23.000Z | utils.py | wilile26811249/ConvMixer | e3a2bcbedb8e8c2b7b5f942ed0ae55473940d47c | [
"MIT"
] | 8 | 2021-10-09T13:05:20.000Z | 2022-01-16T04:46:41.000Z | from typing import List, Optional
import numpy as np
import torch
from torchvision import datasets
from torchvision import transforms as T
class AverageMeter(object):
def __init__(self,
name: str,
fmt: Optional[str] = ':f',
) -> None:
self.name = name
self.fmt = fmt
sel... | 28.798969 | 111 | 0.576517 | from typing import List, Optional
import numpy as np
import torch
from torchvision import datasets
from torchvision import transforms as T
class AverageMeter(object):
def __init__(self,
name: str,
fmt: Optional[str] = ':f',
) -> None:
self.name = name
self.fmt = fmt
sel... | true | true |
f762bd2940a3a977eaab646c3090e8ecf3223b35 | 984 | py | Python | setup.py | WillButAgain/geometric-vector-perceptron | 8628ca06028decc905992a64beda997e8f9627f9 | [
"MIT"
] | 2 | 2021-01-23T18:33:36.000Z | 2021-01-24T18:50:36.000Z | setup.py | WillButAgain/geometric-vector-perceptron | 8628ca06028decc905992a64beda997e8f9627f9 | [
"MIT"
] | null | null | null | setup.py | WillButAgain/geometric-vector-perceptron | 8628ca06028decc905992a64beda997e8f9627f9 | [
"MIT"
] | 2 | 2021-06-09T16:35:28.000Z | 2021-08-05T15:27:53.000Z | from setuptools import setup, find_packages
setup(
name = 'geometric-vector-perceptron',
packages = find_packages(),
version = '0.0.12',
license='MIT',
description = 'Geometric Vector Perceptron - Pytorch',
author = 'Phil Wang, Eric Alcaide',
author_email = 'lucidrains@gmail.com',
url = 'https://github... | 24 | 68 | 0.642276 | from setuptools import setup, find_packages
setup(
name = 'geometric-vector-perceptron',
packages = find_packages(),
version = '0.0.12',
license='MIT',
description = 'Geometric Vector Perceptron - Pytorch',
author = 'Phil Wang, Eric Alcaide',
author_email = 'lucidrains@gmail.com',
url = 'https://github... | true | true |
f762bd41884f25f7342c6dcb4c4759804fbcae8c | 1,546 | py | Python | setup.py | josesho/bootstrap-contrast | 94fa42a5dc4622be016e2e522d1f07b19ba23a8d | [
"MIT"
] | 3 | 2017-12-19T12:55:03.000Z | 2021-01-30T14:14:08.000Z | setup.py | josesho/bootstrap-contrast | 94fa42a5dc4622be016e2e522d1f07b19ba23a8d | [
"MIT"
] | null | null | null | setup.py | josesho/bootstrap-contrast | 94fa42a5dc4622be016e2e522d1f07b19ba23a8d | [
"MIT"
] | 3 | 2017-07-14T08:04:30.000Z | 2017-11-29T04:53:56.000Z | from setuptools import setup, find_packages
import os
# Taken from setup.py in seaborn.
# temporarily redirect config directory to prevent matplotlib importing
# testing that for writeable directory which results in sandbox error in
# certain easy_install versions
os.environ["MPLCONFIGDIR"]="."
# Modified from from se... | 27.122807 | 101 | 0.686287 | from setuptools import setup, find_packages
import os
os.environ["MPLCONFIGDIR"]="."
try:
from setuptools import setup
_has_setuptools=True
except ImportError:
from distutils.core import setup
def check_dependencies():
to_install=[]
try:
import numpy
except ImportError:
to_ins... | true | true |
f762bdb3871503759050b97b4f23f8a63eebbb37 | 7,022 | py | Python | tests/test_context.py | xinxi1990/httprunner_x | 785e5e6e14a3bfc3cb2b5458e13f478fb2449abb | [
"Apache-2.0"
] | null | null | null | tests/test_context.py | xinxi1990/httprunner_x | 785e5e6e14a3bfc3cb2b5458e13f478fb2449abb | [
"Apache-2.0"
] | null | null | null | tests/test_context.py | xinxi1990/httprunner_x | 785e5e6e14a3bfc3cb2b5458e13f478fb2449abb | [
"Apache-2.0"
] | null | null | null | import os
from httprunner_x import context, exceptions, loader, parser, runner
from tests.api_server import gen_md5
from tests.base import ApiServerUnittest, gen_random_string
class TestContext(ApiServerUnittest):
def setUp(self):
loader.load_project_data(os.path.join(os.getcwd(), "tests"))
self... | 37.153439 | 97 | 0.499858 | import os
from httprunner_x import context, exceptions, loader, parser, runner
from tests.api_server import gen_md5
from tests.base import ApiServerUnittest, gen_random_string
class TestContext(ApiServerUnittest):
def setUp(self):
loader.load_project_data(os.path.join(os.getcwd(), "tests"))
self... | true | true |
f762be0601df737a5cf06bae489096f89e56e193 | 5,515 | py | Python | substream/main.py | aniket-amagi/substream | 2b5e41c96a30541e8f7210de87551030a4bf45d9 | [
"MIT"
] | 1 | 2021-04-18T04:01:36.000Z | 2021-04-18T04:01:36.000Z | substream/main.py | aniket-amagi/substream | 2b5e41c96a30541e8f7210de87551030a4bf45d9 | [
"MIT"
] | null | null | null | substream/main.py | aniket-amagi/substream | 2b5e41c96a30541e8f7210de87551030a4bf45d9 | [
"MIT"
] | null | null | null | import logging
import os
import time
from speech_utils import audio_to_words
from srt_utils import (
words_to_srt, jsonl_to_srt
)
from tempbucket import TemporaryBucket
__all__ = ["main", "cli_main"]
def main(filename_or_gs_path: str, srt_filename,
language_code="en-US", speech_contexts_file=None, prof... | 34.905063 | 97 | 0.580054 | import logging
import os
import time
from speech_utils import audio_to_words
from srt_utils import (
words_to_srt, jsonl_to_srt
)
from tempbucket import TemporaryBucket
__all__ = ["main", "cli_main"]
def main(filename_or_gs_path: str, srt_filename,
language_code="en-US", speech_contexts_file=None, prof... | true | true |
f762be2ea463b4e320a2312df6fcaf9073465be6 | 1,954 | py | Python | pymatgen/analysis/piezo.py | exenGT/pymatgen | a8ffb820ab8fc3f60251099e38c8888f45eae618 | [
"MIT"
] | 1 | 2021-11-02T21:10:11.000Z | 2021-11-02T21:10:11.000Z | pymatgen/analysis/piezo.py | exenGT/pymatgen | a8ffb820ab8fc3f60251099e38c8888f45eae618 | [
"MIT"
] | 5 | 2018-08-07T23:00:23.000Z | 2021-01-05T22:46:23.000Z | pymatgen/analysis/piezo.py | exenGT/pymatgen | a8ffb820ab8fc3f60251099e38c8888f45eae618 | [
"MIT"
] | 6 | 2019-04-26T18:50:41.000Z | 2020-03-29T17:58:34.000Z | # Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes for the Piezoelectric tensor
"""
import warnings
import numpy as np
from pymatgen.core.tensors import Tensor
__author__ = "Shyam Dwaraknath"
__copyright__ = "Copyright 2016, The Materials P... | 30.061538 | 84 | 0.626919 |
import warnings
import numpy as np
from pymatgen.core.tensors import Tensor
__author__ = "Shyam Dwaraknath"
__copyright__ = "Copyright 2016, The Materials Project"
__version__ = "1.0"
__maintainer__ = "Shyam Dwaraknath"
__email__ = "shyamd@lbl.gov"
__status__ = "Development"
__date__ = "Feb, 2016"
class PiezoTen... | true | true |
f762be92cbd4d0af01d0dd42ecc1fb37b29c7ade | 3,745 | py | Python | gratipay/models/exchange_route.py | stefb965/gratipay.com | 5f3b5922d6b3a7ff64f51574a1087bab2378cbd8 | [
"CC0-1.0"
] | null | null | null | gratipay/models/exchange_route.py | stefb965/gratipay.com | 5f3b5922d6b3a7ff64f51574a1087bab2378cbd8 | [
"CC0-1.0"
] | null | null | null | gratipay/models/exchange_route.py | stefb965/gratipay.com | 5f3b5922d6b3a7ff64f51574a1087bab2378cbd8 | [
"CC0-1.0"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import braintree
from postgres.orm import Model
class ExchangeRoute(Model):
typname = "exchange_routes"
def __bool__(self):
return self.error != 'invalidated'
__nonzero__ = __bool__
@classmethod
def fro... | 34.357798 | 94 | 0.594393 | from __future__ import absolute_import, division, print_function, unicode_literals
import braintree
from postgres.orm import Model
class ExchangeRoute(Model):
typname = "exchange_routes"
def __bool__(self):
return self.error != 'invalidated'
__nonzero__ = __bool__
@classmethod
def fro... | true | true |
f762beccfe08173d6673212828c5976ad98797cc | 86,643 | py | Python | modules/s3/s3utils.py | anurag-ks/eden | 18c810b5225c54f29392c3b477e75ffb3bb44470 | [
"MIT"
] | 1 | 2015-01-24T04:31:51.000Z | 2015-01-24T04:31:51.000Z | modules/s3/s3utils.py | anurag-ks/eden | 18c810b5225c54f29392c3b477e75ffb3bb44470 | [
"MIT"
] | null | null | null | modules/s3/s3utils.py | anurag-ks/eden | 18c810b5225c54f29392c3b477e75ffb3bb44470 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Utilities
@requires: U{B{I{gluon}} <http://web2py.com>}
@copyright: (c) 2010-2015 Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Softwa... | 34.071176 | 188 | 0.48364 |
""" Utilities
@requires: U{B{I{gluon}} <http://web2py.com>}
@copyright: (c) 2010-2015 Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Sof... | false | true |
f762bf553c161d18dba8e0bea95d5c9c3f7b14fc | 7,722 | py | Python | general/calculate_performance_dataset.py | j-lazo/lumen_segmentation | 442b6e642b4743e6b7bf56ab77e11e8e95062ed7 | [
"CC0-1.0"
] | null | null | null | general/calculate_performance_dataset.py | j-lazo/lumen_segmentation | 442b6e642b4743e6b7bf56ab77e11e8e95062ed7 | [
"CC0-1.0"
] | null | null | null | general/calculate_performance_dataset.py | j-lazo/lumen_segmentation | 442b6e642b4743e6b7bf56ab77e11e8e95062ed7 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 9 16:18:55 2020
@author: jlazo
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 26 01:18:22 2020
@author: jlazo
"""
import os
import numpy as np
import cv2
from glob import glob
from sklearn.model_selection import train_... | 31.647541 | 128 | 0.640896 |
import os
import numpy as np
import cv2
from glob import glob
from sklearn.model_selection import train_test_split
from os import listdir
from matplotlib import pyplot as plt
from sklearn.metrics import average_precision_score
from sklearn.metrics import recall_score
from sklearn.metrics import accuracy_score
impor... | true | true |
f762c03ddfe364edb37bc21c71190e64acc81025 | 166 | py | Python | Dataset/Leetcode/train/70/35.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/70/35.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/70/35.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution(object):
def XXX(self, n):
dp = [0, 1]
for i in range(n):
dp[i%2] = dp[i%2] + dp[(i+1)%2]
return dp[(n+1)%2]
| 18.444444 | 43 | 0.421687 | class Solution(object):
def XXX(self, n):
dp = [0, 1]
for i in range(n):
dp[i%2] = dp[i%2] + dp[(i+1)%2]
return dp[(n+1)%2]
| true | true |
f762c093c822c644f705f207047d58f9e6b8ee1d | 581 | py | Python | geminipy/helpers.py | Vanclief/gemini-python | 8472e32b3db436d4a9ef5c1b9ea376109f23845c | [
"MIT"
] | null | null | null | geminipy/helpers.py | Vanclief/gemini-python | 8472e32b3db436d4a9ef5c1b9ea376109f23845c | [
"MIT"
] | null | null | null | geminipy/helpers.py | Vanclief/gemini-python | 8472e32b3db436d4a9ef5c1b9ea376109f23845c | [
"MIT"
] | null | null | null | def dict_to_float(d):
"""
Converts all strings to floats from a dict
"""
if type(d) is dict:
for key, value in d.items():
if type(value) is str:
try:
d[key] = float(value)
except ValueError:
d[key] = str(value)
... | 19.366667 | 53 | 0.483649 | def dict_to_float(d):
if type(d) is dict:
for key, value in d.items():
if type(value) is str:
try:
d[key] = float(value)
except ValueError:
d[key] = str(value)
return d
def list_dict_to_float(l):
for d in l:
... | true | true |
f762c18833dc7573dd2a886a3e1dab142c9ead05 | 3,044 | py | Python | src/Tools/CodeGenerator/Plugins/MLNetPluginImpl/SparseVectorTypeInfoFactory.py | Lisiczka27/FeaturizersLibrary | dc7b42abd39589af0668c896666affb4abe8a622 | [
"MIT"
] | 1 | 2021-01-23T09:19:25.000Z | 2021-01-23T09:19:25.000Z | src/Tools/CodeGenerator/Plugins/MLNetPluginImpl/SparseVectorTypeInfoFactory.py | Lisiczka27/FeaturizersLibrary | dc7b42abd39589af0668c896666affb4abe8a622 | [
"MIT"
] | null | null | null | src/Tools/CodeGenerator/Plugins/MLNetPluginImpl/SparseVectorTypeInfoFactory.py | Lisiczka27/FeaturizersLibrary | dc7b42abd39589af0668c896666affb4abe8a622 | [
"MIT"
] | null | null | null | # ----------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License
# ----------------------------------------------------------------------
"""Contains the SparseVectorTypeInfoFactory object"""
import os
import re... | 37.121951 | 119 | 0.426084 |
import os
import re
import textwrap
import CommonEnvironment
from CommonEnvironment import Interface
from Plugins.MLNetPluginImpl.TypeInfoFactory import TypeInfoFactory
_script_fullpath = CommonEnvironment.ThisFullpath()
_script_dir, _script_name = os.path.spl... | true | true |
f762c20e3bb72ac9c31d341609828e60a40b1e7e | 11,877 | py | Python | tests/test_traversal.py | camillescott/boink | db75dc0d87126c5ad20c35405699d89153f109a8 | [
"MIT"
] | 3 | 2019-03-10T02:30:16.000Z | 2020-02-07T20:11:26.000Z | tests/test_traversal.py | camillescott/boink | db75dc0d87126c5ad20c35405699d89153f109a8 | [
"MIT"
] | 6 | 2018-04-11T02:01:18.000Z | 2020-01-31T14:21:55.000Z | tests/test_traversal.py | camillescott/goetia | 677e3ef028be6b70a2dacbcf7a4e83f4bb9fdf9a | [
"MIT"
] | 2 | 2019-03-09T19:15:08.000Z | 2019-04-18T19:27:08.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# (c) Camille Scott, 2019
# File : test_traversal.py
# License: MIT
# Author : Camille Scott <camille.scott.w@gmail.com>
# Date : 08.10.2019
import pytest
from goetia import libgoetia
from goetia.traversal import STATES
from .utils import *
def test_cursor(graph,... | 33.175978 | 112 | 0.621201 |
import pytest
from goetia import libgoetia
from goetia.traversal import STATES
from .utils import *
def test_cursor(graph, ksize):
seed = 'A' * ksize
graph.cursor = seed
assert graph.cursor == seed
def test_cursor_wrong_size(graph, ksize):
seed = 'A' * (ksize - 1)
with pytest.raises(Ba... | true | true |
f762c382ac19a79be3e7ff6e8ca53f569ad48d3c | 1,187 | py | Python | Python/coin-change.py | bssrdf/LeetCode-5 | 746df5cff523361145a74d9d429dc541a7b99910 | [
"MIT"
] | 68 | 2018-01-13T07:15:37.000Z | 2022-02-20T12:58:24.000Z | Python/coin-change.py | bssrdf/LeetCode-5 | 746df5cff523361145a74d9d429dc541a7b99910 | [
"MIT"
] | 2 | 2021-12-10T01:43:37.000Z | 2021-12-14T21:48:53.000Z | Python/coin-change.py | bssrdf/LeetCode-5 | 746df5cff523361145a74d9d429dc541a7b99910 | [
"MIT"
] | 63 | 2017-04-10T03:38:25.000Z | 2022-03-17T23:24:51.000Z | # Time: O(n * k), n is the number of coins, k is the amount of money
# Space: O(k)
#
# You are given coins of different denominations and
# a total amount of money amount. Write a function to
# compute the fewest number of coins that you need to
# make up that amount. If that amount of money cannot
# be made up by any... | 30.435897 | 82 | 0.577085 |
class Solution(object):
def coinChange(self, coins, amount):
INF = 0x7fffffff amounts = [INF] * (amount + 1)
amounts[0] = 0
for i in xrange(amount + 1):
if amounts[i] != INF:
for coin in coins:
if i + coin <= amount:
... | true | true |
f762c4205d5ee048e4f3c761d4c9f45186378bc0 | 379 | py | Python | openpype/pipeline/lib/__init__.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | null | null | null | openpype/pipeline/lib/__init__.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | null | null | null | openpype/pipeline/lib/__init__.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | null | null | null | from .attribute_definitions import (
AbtractAttrDef,
UIDef,
UISeparatorDef,
UILabelDef,
UnknownDef,
NumberDef,
TextDef,
EnumDef,
BoolDef,
FileDef,
)
__all__ = (
"AbtractAttrDef",
"UIDef",
"UISeparatorDef",
"UILabelDef",
"UnknownDef",
"NumberDef",
... | 12.225806 | 36 | 0.575198 | from .attribute_definitions import (
AbtractAttrDef,
UIDef,
UISeparatorDef,
UILabelDef,
UnknownDef,
NumberDef,
TextDef,
EnumDef,
BoolDef,
FileDef,
)
__all__ = (
"AbtractAttrDef",
"UIDef",
"UISeparatorDef",
"UILabelDef",
"UnknownDef",
"NumberDef",
... | true | true |
f762c5d884021e04ab47f518124efb13075e301f | 5,764 | py | Python | examples/to-be-fixed/pihm2cycles/pihm2cycles_func.py | raunaqtri1/MINT-Transformation | cdb95ff3ee05b109e5f2a1016d52702819691701 | [
"MIT"
] | 1 | 2020-09-29T15:27:52.000Z | 2020-09-29T15:27:52.000Z | examples/to-be-fixed/pihm2cycles/pihm2cycles_func.py | raunaqtri1/MINT-Transformation | cdb95ff3ee05b109e5f2a1016d52702819691701 | [
"MIT"
] | 19 | 2020-05-01T21:16:39.000Z | 2021-06-09T19:42:59.000Z | examples/to-be-fixed/pihm2cycles/pihm2cycles_func.py | raunaqtri1/MINT-Transformation | cdb95ff3ee05b109e5f2a1016d52702819691701 | [
"MIT"
] | 3 | 2020-05-04T22:44:54.000Z | 2020-05-06T23:16:35.000Z | import json
from datetime import timedelta
from drepr import Graph
from dtran import IFunc, ArgType
class Pihm2CyclesFunc(IFunc):
id = "pihm2cycles_func"
inputs = {
"pihm_data_graph": ArgType.DataSet(None),
"pihm_soil_graph": ArgType.DataSet(None),
"pid_graph": ArgType.DataSet(None),... | 38.684564 | 109 | 0.576509 | import json
from datetime import timedelta
from drepr import Graph
from dtran import IFunc, ArgType
class Pihm2CyclesFunc(IFunc):
id = "pihm2cycles_func"
inputs = {
"pihm_data_graph": ArgType.DataSet(None),
"pihm_soil_graph": ArgType.DataSet(None),
"pid_graph": ArgType.DataSet(None),... | true | true |
f762c613e12e17666d957f3420ff7cedfe82b4cc | 2,377 | py | Python | dnu_calculator.py | mrawls/ELCtools | 7e15bf24c453ed4300c6f19f01cff74c041158b8 | [
"MIT"
] | 2 | 2018-10-08T04:59:38.000Z | 2021-01-19T08:10:04.000Z | dnu_calculator.py | mrawls/ELCtools | 7e15bf24c453ed4300c6f19f01cff74c041158b8 | [
"MIT"
] | 1 | 2021-07-20T16:42:43.000Z | 2021-07-20T16:42:43.000Z | dnu_calculator.py | mrawls/ELCtools | 7e15bf24c453ed4300c6f19f01cff74c041158b8 | [
"MIT"
] | 1 | 2018-07-31T14:36:24.000Z | 2018-07-31T14:36:24.000Z | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from astropy import units as u
'''
Meredith Rawls, 2015
Takes masses, radii, and chi2s from an ELC run and makes delta_nu distributions.
Assumes a fixed temperature for each star.
'''
dir = '../../RG_ELCmodeling/9246715/demcmc001/'... | 34.955882 | 87 | 0.689945 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from astropy import units as u
dir = '../../RG_ELCmodeling/9246715/demcmc001/'
starparmfile = 'starparm.all'
chifile = 'chi.all'
outfile = 'deltanu_ELCcalc.txt'
nplotbins = 100
print('Reading in giant files, be patient...')
M1s, M... | true | true |
f762c61df0fa34c60d0bb531f37f427a1f06daba | 62,446 | py | Python | numpyro/distributions/continuous.py | jackpotrykus/numpyro | 7dd505c347378e8ea8393ed847c8c46f4bd43963 | [
"Apache-2.0"
] | null | null | null | numpyro/distributions/continuous.py | jackpotrykus/numpyro | 7dd505c347378e8ea8393ed847c8c46f4bd43963 | [
"Apache-2.0"
] | null | null | null | numpyro/distributions/continuous.py | jackpotrykus/numpyro | 7dd505c347378e8ea8393ed847c8c46f4bd43963 | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
# The implementation largely follows the design in PyTorch's `torch.distributions`
#
# Copyright (c) 2016- Facebook, Inc (Adam Paszke)
# Copyright (c) 2014- Facebook, Inc (Soumith Chintala)
# Copyright (c)... | 37.800242 | 136 | 0.632274 |
#
# Copyright (c) 2016- Facebook, Inc (Adam Paszke)
# Copyright (c) 2014- Facebook, Inc (Soumith Chintala)
# Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert)
# Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu)
# Copyright (c) 2011-2012 NEC Laboratories... | true | true |
f762c687420035abcb843e420a0489a6453f0657 | 17,931 | py | Python | tests/analyses/milhdbk217f/models/test_inductor.py | TahaEntezari/ramstk | f82e5b31ef5c4e33cc02252263247b99a9abe129 | [
"BSD-3-Clause"
] | 26 | 2019-05-15T02:03:47.000Z | 2022-02-21T07:28:11.000Z | tests/analyses/milhdbk217f/models/test_inductor.py | TahaEntezari/ramstk | f82e5b31ef5c4e33cc02252263247b99a9abe129 | [
"BSD-3-Clause"
] | 815 | 2019-05-10T12:31:52.000Z | 2022-03-31T12:56:26.000Z | tests/analyses/milhdbk217f/models/test_inductor.py | TahaEntezari/ramstk | f82e5b31ef5c4e33cc02252263247b99a9abe129 | [
"BSD-3-Clause"
] | 9 | 2019-04-20T23:06:29.000Z | 2022-01-24T21:21:04.000Z | # pylint: skip-file
# type: ignore
# -*- coding: utf-8 -*-
#
# tests.analyses.milhdbk217f.models.test_inductor.py is part of The
# RAMSTK Project
#
# All rights reserved.
# Copyright 2007 - 2017 Doyle Rowland doyle.rowland <AT> reliaqual <DOT> com
"""Test class for the inductor module."""
# Third Party Imp... | 28.327014 | 83 | 0.572974 |
import pytest
from ramstk.analyses.milhdbk217f import inductor
ATTRIBUTES = {
"category_id": 5,
"subcategory_id": 1,
"environment_active_id": 3,
"insulation_id": 3,
"family_id": 1,
"construction_id": 1,
"specification_id": 1,
"quality_id": 1,
"page_number": 3,
"area": 12.5,
... | true | true |
f762c6c8665a388ffd64ec1ded0cf4818d8f89fe | 9,280 | py | Python | src/utils/read_datasets.py | canbakiskan/sparse_coding_frontend | 1f62b54824785aa441317ddab1baa3012f2fb401 | [
"Apache-2.0"
] | 1 | 2021-05-26T07:00:28.000Z | 2021-05-26T07:00:28.000Z | src/utils/read_datasets.py | canbakiskan/sparse_coding_frontend | 1f62b54824785aa441317ddab1baa3012f2fb401 | [
"Apache-2.0"
] | null | null | null | src/utils/read_datasets.py | canbakiskan/sparse_coding_frontend | 1f62b54824785aa441317ddab1baa3012f2fb401 | [
"Apache-2.0"
] | null | null | null | import torch
from torchvision import datasets, transforms
import numpy as np
from os.path import join
from .namers import attack_file_namer
def tiny_imagenet(args):
data_dir = join(args.directory, 'data')
train_dir = join(data_dir, "original_datasets",
"tiny-imagenet-200", "train")
... | 30.933333 | 106 | 0.668858 | import torch
from torchvision import datasets, transforms
import numpy as np
from os.path import join
from .namers import attack_file_namer
def tiny_imagenet(args):
data_dir = join(args.directory, 'data')
train_dir = join(data_dir, "original_datasets",
"tiny-imagenet-200", "train")
... | true | true |
f762c76c48af56c3a4bf865cd9c71f8f86cdfe2b | 15,081 | py | Python | src/datapanels/gameoflife.py | man-vs-electron/datapanels | d656bbd3c6071cc2d26bd27285001aee1fa7c82d | [
"Apache-2.0"
] | null | null | null | src/datapanels/gameoflife.py | man-vs-electron/datapanels | d656bbd3c6071cc2d26bd27285001aee1fa7c82d | [
"Apache-2.0"
] | 7 | 2021-11-27T18:04:56.000Z | 2022-01-30T18:35:57.000Z | src/datapanels/gameoflife.py | man-vs-electron/datapanels | d656bbd3c6071cc2d26bd27285001aee1fa7c82d | [
"Apache-2.0"
] | null | null | null | """ DataPanels implementation of Conway's Game of Life
See https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life for details about
the game.
"""
import random
from typing import Tuple, Set, Optional, Union, List
import re
import numpy as np
from kivy.lang.builder import Builder
from kivy.properties import ListPropert... | 38.27665 | 197 | 0.653339 | import random
from typing import Tuple, Set, Optional, Union, List
import re
import numpy as np
from kivy.lang.builder import Builder
from kivy.properties import ListProperty, NumericProperty, ObjectProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.dropdown import DropDo... | true | true |
f762c76d91e13629122c6ee944de08a2221cd193 | 1,006 | py | Python | pywikibot/families/wikivoyage_family.py | metakgp/pywikibot | 28e3125167bb3ec521a25ade859d0e0afcfb1262 | [
"MIT"
] | 2 | 2017-06-19T16:48:34.000Z | 2017-07-07T14:15:28.000Z | pywikibot/families/wikivoyage_family.py | metakgp/pywikibot | 28e3125167bb3ec521a25ade859d0e0afcfb1262 | [
"MIT"
] | 11 | 2018-12-07T18:20:05.000Z | 2022-03-11T23:12:42.000Z | pywikibot/families/wikivoyage_family.py | metakgp/pywikibot | 28e3125167bb3ec521a25ade859d0e0afcfb1262 | [
"MIT"
] | 3 | 2018-12-09T10:18:35.000Z | 2020-09-12T13:50:14.000Z | # -*- coding: utf-8 -*-
"""Family module for Wikivoyage."""
from __future__ import absolute_import, unicode_literals
__version__ = '$Id: f762c76d91e13629122c6ee944de08a2221cd193 $'
# The new wikivoyage family that is hosted at wikimedia
from pywikibot import family
class Family(family.SubdomainFamily, family.Wikim... | 29.588235 | 90 | 0.630219 | from __future__ import absolute_import, unicode_literals
__version__ = '$Id: f762c76d91e13629122c6ee944de08a2221cd193 $'
from pywikibot import family
class Family(family.SubdomainFamily, family.WikimediaFamily):
name = 'wikivoyage'
def __init__(self):
self.languages_by_size = [
'en',... | true | true |
f762c7bdc86a294d92230dfbe8e2ac8c7b23e00a | 6,575 | py | Python | src/python/pants/backend/python/lint/docformatter/rules_integration_test.py | pyranja/pants | f48b32a61e2d3f017a115fb0ce6cb044f53e36d6 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/lint/docformatter/rules_integration_test.py | pyranja/pants | f48b32a61e2d3f017a115fb0ce6cb044f53e36d6 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/lint/docformatter/rules_integration_test.py | pyranja/pants | f48b32a61e2d3f017a115fb0ce6cb044f53e36d6 | [
"Apache-2.0"
] | 2 | 2020-05-18T18:43:11.000Z | 2020-05-19T02:47:47.000Z | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from typing import List, Optional, Tuple
from pants.backend.python.lint.docformatter.rules import DocformatterFieldSet, DocformatterFieldSets
from pants.backend.python.lint.docformatter.r... | 45.979021 | 100 | 0.697338 |
from typing import List, Optional, Tuple
from pants.backend.python.lint.docformatter.rules import DocformatterFieldSet, DocformatterFieldSets
from pants.backend.python.lint.docformatter.rules import rules as docformatter_rules
from pants.backend.python.target_types import PythonLibrary
from pants.base.specs import Fi... | true | true |
f762c8a13758442cfd9e450d7a02bb983e3903ed | 177 | py | Python | dtf/settings.py | civviGH/django-testing-framework | b699f7c4cf58dcc39b398b182b89c3232b5a6d7f | [
"MIT"
] | 1 | 2020-11-17T14:38:29.000Z | 2020-11-17T14:38:29.000Z | dtf/settings.py | civviGH/django-testing-framework | b699f7c4cf58dcc39b398b182b89c3232b5a6d7f | [
"MIT"
] | 31 | 2020-11-17T14:03:14.000Z | 2021-02-22T14:50:29.000Z | dtf/settings.py | civviGH/django-testing-framework | b699f7c4cf58dcc39b398b182b89c3232b5a6d7f | [
"MIT"
] | 1 | 2020-11-25T07:32:42.000Z | 2020-11-25T07:32:42.000Z | STATUS_TEXT_COLORS = {
"successful":"green",
"unstable":"goldenrod",
"failed":"firebrick",
"broken":"maroon",
"unknown":"grey",
"skip":"cornflowerblue"
} | 22.125 | 27 | 0.59887 | STATUS_TEXT_COLORS = {
"successful":"green",
"unstable":"goldenrod",
"failed":"firebrick",
"broken":"maroon",
"unknown":"grey",
"skip":"cornflowerblue"
} | true | true |
f762c9bdfe273a3077422f3b0d82b85e81425a40 | 2,995 | py | Python | examples/dfp/v201805/premium_rate_service/update_premium_rates.py | christineyi3898/googleads-python-lib | cd707dc897b93cf1bbb19355f7424e7834e7fb55 | [
"Apache-2.0"
] | 1 | 2019-10-21T04:10:22.000Z | 2019-10-21T04:10:22.000Z | examples/dfp/v201805/premium_rate_service/update_premium_rates.py | christineyi3898/googleads-python-lib | cd707dc897b93cf1bbb19355f7424e7834e7fb55 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201805/premium_rate_service/update_premium_rates.py | christineyi3898/googleads-python-lib | cd707dc897b93cf1bbb19355f7424e7834e7fb55 | [
"Apache-2.0"
] | 1 | 2019-10-21T04:10:51.000Z | 2019-10-21T04:10:51.000Z | #!/usr/bin/env python
#
# Copyright 2015 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 requir... | 34.034091 | 80 | 0.684474 |
"""This example updates a premium rate to add a flat fee to an existing feature.
To determine which premium rates exist, run get_all_premium_rates.py.
"""
from googleads import dfp
PREMIUM_RATE_ID = 'INSERT_PREMIUM_RATE_ID_HERE'
def main(client, premium_rate_id):
premium_rate_service = client.GetService('Pr... | false | true |
f762cab1562ad5e601d79a6b0e58b96749ba66a5 | 119,268 | py | Python | tesla_dashcam/tesla_dashcam.py | busbyjon/tesla_dashcam | d0f8f05ac42fa4b9a4920f080865b80c23e49695 | [
"Apache-2.0"
] | null | null | null | tesla_dashcam/tesla_dashcam.py | busbyjon/tesla_dashcam | d0f8f05ac42fa4b9a4920f080865b80c23e49695 | [
"Apache-2.0"
] | null | null | null | tesla_dashcam/tesla_dashcam.py | busbyjon/tesla_dashcam | d0f8f05ac42fa4b9a4920f080865b80c23e49695 | [
"Apache-2.0"
] | null | null | null | """
Merges the 3 Tesla Dashcam and Sentry camera video files into 1 video. If
then further concatenates the files together to make 1 movie.
"""
import argparse
import logging
import os
import sys
from datetime import datetime, timedelta, timezone
from fnmatch import fnmatch
from glob import glob
from pathlib import Pat... | 35.613019 | 119 | 0.553367 | import argparse
import logging
import os
import sys
from datetime import datetime, timedelta, timezone
from fnmatch import fnmatch
from glob import glob
from pathlib import Path
from re import search
from shlex import split as shlex_split
from shutil import which
from subprocess import CalledProcessError, run
from temp... | true | true |
f762cb39b3a8b0f8aad39c0509efc7df619bc403 | 4,264 | py | Python | evaluation/src/cse/logs/eventmatcher.py | inetrg/spoki | 599a19366e4cea70e2391471de6f6b745935cddf | [
"MIT"
] | 1 | 2022-02-03T15:35:16.000Z | 2022-02-03T15:35:16.000Z | evaluation/src/cse/logs/eventmatcher.py | inetrg/spoki | 599a19366e4cea70e2391471de6f6b745935cddf | [
"MIT"
] | null | null | null | evaluation/src/cse/logs/eventmatcher.py | inetrg/spoki | 599a19366e4cea70e2391471de6f6b745935cddf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Events, i.e., received packets and their probe requests, are sorted and matched
together to identify two-phase events.
"""
__maintainer__ = "Raphael Hiesgen"
__email__ = "raphael.hiesgen@haw-hamburg.de"
__copyright__ = "Copyright 2018-2021"
from datetime import datet... | 35.239669 | 79 | 0.540103 |
__maintainer__ = "Raphael Hiesgen"
__email__ = "raphael.hiesgen@haw-hamburg.de"
__copyright__ = "Copyright 2018-2021"
from datetime import datetime, timedelta, timezone
def make_file_timestr(timeobject):
utc_time = timeobject.astimezone(timezone.utc)
return utc_time.strftime("%Y%m%d-%H%M%S")
def file_t... | true | true |
f762cb9f4f164b6f2dc24b41760282d4be170b00 | 2,415 | py | Python | src/tests/test_group_user_a_create.py | devsetgo/test-api | 2a84bbacbf5cd043b2227e74332e8518927a8238 | [
"MIT"
] | 9 | 2019-05-22T08:46:01.000Z | 2021-12-10T06:44:56.000Z | src/tests/test_group_user_a_create.py | devsetgo/test-api | 2a84bbacbf5cd043b2227e74332e8518927a8238 | [
"MIT"
] | 285 | 2019-09-03T00:52:39.000Z | 2022-02-13T02:13:59.000Z | src/tests/test_group_user_a_create.py | devsetgo/test-api | 2a84bbacbf5cd043b2227e74332e8518927a8238 | [
"MIT"
] | 4 | 2019-09-19T18:14:09.000Z | 2020-12-15T18:35:07.000Z | # -*- coding: utf-8 -*-
import unittest
import uuid
from starlette.testclient import TestClient
from src.core.file_functions import open_json, save_json
from src.main import app
client = TestClient(app)
directory_to__files: str = "data"
# api/v1/groups/list?delay=1&qty=10&offset=1&active=true&groupType=approval
cla... | 31.776316 | 75 | 0.601656 | import unittest
import uuid
from starlette.testclient import TestClient
from src.core.file_functions import open_json, save_json
from src.main import app
client = TestClient(app)
directory_to__files: str = "data"
class Test(unittest.TestCase):
def test_groups_post_user_error(self):
group_id = open_json(... | true | true |
f762cec86682ed464977ef5e76ec03caa9e39151 | 48,021 | py | Python | tensorflow/python/kernel_tests/cwise_ops_test.py | leike666666/tensorflow | a3fd0ddfcb716be124e95b51e96e6c1e4507ef64 | [
"Apache-2.0"
] | 12 | 2020-12-28T18:42:10.000Z | 2022-03-24T17:34:21.000Z | tensorflow/python/kernel_tests/cwise_ops_test.py | sagol/tensorflow | 04f2870814d2773e09dcfa00cbe76a66a2c4de88 | [
"Apache-2.0"
] | 2 | 2021-08-25T15:58:11.000Z | 2022-02-10T01:47:24.000Z | tensorflow/python/kernel_tests/cwise_ops_test.py | sagol/tensorflow | 04f2870814d2773e09dcfa00cbe76a66a2c4de88 | [
"Apache-2.0"
] | 3 | 2020-03-09T19:17:02.000Z | 2020-06-26T23:14:31.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.283385 | 80 | 0.631328 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.compat import compat
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes as dtypes_lib
from tensorflow.python.framework... | true | true |
f762cfe90bebd76fbce8daf8252f11aab78a7b27 | 14,630 | py | Python | models/losses.py | chensjtu/poxture | f6abea1216c987f0e4c628b250054d764eaecf2e | [
"Apache-2.0"
] | null | null | null | models/losses.py | chensjtu/poxture | f6abea1216c987f0e4c628b250054d764eaecf2e | [
"Apache-2.0"
] | null | null | null | models/losses.py | chensjtu/poxture | f6abea1216c987f0e4c628b250054d764eaecf2e | [
"Apache-2.0"
] | null | null | null | # this code is for calculate the VGGloss, which also called percetual loss.
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
from typing import Union
import math
class VGG19(nn.Module):
"""
Sequential(
(0): Conv2d(3, 64, kernel_size=(3, 3), stride=(1, ... | 43.541667 | 110 | 0.589337 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
from typing import Union
import math
class VGG19(nn.Module):
def __init__(self, ckpt_path: Union[str, bool] = "./extradata/assets/pretrains/vgg19-dcbb9e9d.pth",
requires_grad=False, before_relu=False... | true | true |
f762d0915302a8196bbaa04f02cba379793292f9 | 2,994 | py | Python | docs/source/conf.py | YiweiLi4/tensorbay-python-sdk | 20fc8b37bad01c2d201a87b1436f1d4ff77d76df | [
"MIT"
] | null | null | null | docs/source/conf.py | YiweiLi4/tensorbay-python-sdk | 20fc8b37bad01c2d201a87b1436f1d4ff77d76df | [
"MIT"
] | null | null | null | docs/source/conf.py | YiweiLi4/tensorbay-python-sdk | 20fc8b37bad01c2d201a87b1436f1d4ff77d76df | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2021 Graviti. Licensed under MIT License.
#
# pylint: disable=missing-module-docstring,invalid-name
#
# 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... | 38.384615 | 95 | 0.698397 |
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parents[2]))
project = "TensorBay"
copyright = "2021, Graviti" author = "Graviti"
extensions = [
"sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.autosummary", "sphinx.ext.todo", "sphinx.ext.ifconfig", ... | true | true |
f762d0aeb03bb7cbceb3b96ac658204b6bb714c1 | 986 | py | Python | exercises/Stacks and Queues/StackOfPlates.py | RakaPKS/StructuresAlgorithmsAndConcepts | 570339f06562ca6dbe4ff7a2f12ec8413b1dcbba | [
"MIT"
] | null | null | null | exercises/Stacks and Queues/StackOfPlates.py | RakaPKS/StructuresAlgorithmsAndConcepts | 570339f06562ca6dbe4ff7a2f12ec8413b1dcbba | [
"MIT"
] | null | null | null | exercises/Stacks and Queues/StackOfPlates.py | RakaPKS/StructuresAlgorithmsAndConcepts | 570339f06562ca6dbe4ff7a2f12ec8413b1dcbba | [
"MIT"
] | null | null | null | from Stack import Stack
class StackOfPlates:
def __init__(self, stackSize):
self.stackSize = stackSize
self.stackList = []
self.stackList.append(Stack())
def push(self, item):
if len(self.stackList[-1]) > self.stackSize:
self.stackList.append(Stack())
self.... | 24.65 | 68 | 0.636917 | from Stack import Stack
class StackOfPlates:
def __init__(self, stackSize):
self.stackSize = stackSize
self.stackList = []
self.stackList.append(Stack())
def push(self, item):
if len(self.stackList[-1]) > self.stackSize:
self.stackList.append(Stack())
self.... | true | true |
f762d0fd6515752b76a23675917f8e34f5407d35 | 7,243 | py | Python | selfdrive/car/toyota/carcontroller.py | andretag/openpilot | e5e5aa7ded6b4b9d4536e5df23d491d6a1cd61c4 | [
"MIT"
] | null | null | null | selfdrive/car/toyota/carcontroller.py | andretag/openpilot | e5e5aa7ded6b4b9d4536e5df23d491d6a1cd61c4 | [
"MIT"
] | null | null | null | selfdrive/car/toyota/carcontroller.py | andretag/openpilot | e5e5aa7ded6b4b9d4536e5df23d491d6a1cd61c4 | [
"MIT"
] | 1 | 2019-08-25T21:25:02.000Z | 2019-08-25T21:25:02.000Z | from common.numpy_fast import clip, interp
from common.realtime import sec_since_boot
from selfdrive.boardd.boardd import can_list_to_can_capnp
from selfdrive.controls.lib.drive_helpers import rate_limit
from selfdrive.car.toyota.toyotacan import make_can_msg, create_video_target,\
... | 38.526596 | 130 | 0.691978 | from common.numpy_fast import clip, interp
from common.realtime import sec_since_boot
from selfdrive.boardd.boardd import can_list_to_can_capnp
from selfdrive.controls.lib.drive_helpers import rate_limit
from selfdrive.car.toyota.toyotacan import make_can_msg, create_video_target,\
... | true | true |
f762d10667b34ecb0ab33c0a5210e2380aee2302 | 48,569 | py | Python | cassandra/connection.py | Newky/python-driver | b56cef9bfba14583552ad9c276d1af3ca1368047 | [
"Apache-2.0"
] | null | null | null | cassandra/connection.py | Newky/python-driver | b56cef9bfba14583552ad9c276d1af3ca1368047 | [
"Apache-2.0"
] | null | null | null | cassandra/connection.py | Newky/python-driver | b56cef9bfba14583552ad9c276d1af3ca1368047 | [
"Apache-2.0"
] | null | null | null | # Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | 37.885335 | 196 | 0.605469 |
from __future__ import absolute_import from collections import defaultdict, deque
import errno
from functools import wraps, partial, total_ordering
from heapq import heappush, heappop
import io
import logging
import six
from six.moves import range
import socket
import struct
import sys
from threading import Thread, E... | true | true |
f762d1f6c845fe6bfbbb15839b0a302b49b9a2ce | 7,737 | py | Python | webapp/proto.py | dssg/babies-public | 0a03e95992bfd7b7b4c2f11b8a5e2c3961f193c6 | [
"MIT"
] | 5 | 2018-09-13T02:26:23.000Z | 2019-10-21T12:38:16.000Z | webapp/proto.py | dssg/babies-public | 0a03e95992bfd7b7b4c2f11b8a5e2c3961f193c6 | [
"MIT"
] | null | null | null | webapp/proto.py | dssg/babies-public | 0a03e95992bfd7b7b4c2f11b8a5e2c3961f193c6 | [
"MIT"
] | 3 | 2015-10-14T19:51:42.000Z | 2022-03-29T07:12:39.000Z | import pandas as pd
import numpy as np
import psycopg2
from sqlalchemy import create_engine
import json
import sys
from sklearn.externals import joblib
import os
def run_all():
# connect to postgres
params = json.load(open('/home/ipan/passwords/psql_psycopg2.password', 'r'))
try:
conn = psycopg2... | 44.211429 | 124 | 0.503425 | import pandas as pd
import numpy as np
import psycopg2
from sqlalchemy import create_engine
import json
import sys
from sklearn.externals import joblib
import os
def run_all():
params = json.load(open('/home/ipan/passwords/psql_psycopg2.password', 'r'))
try:
conn = psycopg2.connect(**params)
... | true | true |
f762d277cdb005a97297042954ca67f965c9d414 | 2,452 | py | Python | test.py | MingSungChao/IPN-hand | 0b061e4438f159e3e312af4959cb424917b5c367 | [
"MIT"
] | 54 | 2020-05-06T15:50:48.000Z | 2022-02-26T04:50:44.000Z | test.py | MingSungChao/IPN-hand | 0b061e4438f159e3e312af4959cb424917b5c367 | [
"MIT"
] | 10 | 2020-09-04T00:55:37.000Z | 2021-09-06T07:20:52.000Z | test.py | MingSungChao/IPN-hand | 0b061e4438f159e3e312af4959cb424917b5c367 | [
"MIT"
] | 15 | 2020-05-07T02:00:41.000Z | 2021-11-07T22:30:03.000Z | import torch
from torch.autograd import Variable
import torch.nn.functional as F
import time
import os
import sys
import json
import pdb
from utils import AverageMeter
def calculate_video_results(output_buffer, video_id, test_results, class_names):
video_outputs = torch.stack(output_buffer)
average_scores = ... | 31.037975 | 82 | 0.573002 | import torch
from torch.autograd import Variable
import torch.nn.functional as F
import time
import os
import sys
import json
import pdb
from utils import AverageMeter
def calculate_video_results(output_buffer, video_id, test_results, class_names):
video_outputs = torch.stack(output_buffer)
average_scores = ... | true | true |
f762d3492e5c5b84aacc86311afca7c0b8055609 | 1,013 | py | Python | instagram_clone/contrib/sites/migrations/0003_set_site_domain_and_name.py | eugene94/IG_clone | 6a525524ec357d5617b09e013b449df2ec9336ad | [
"MIT"
] | null | null | null | instagram_clone/contrib/sites/migrations/0003_set_site_domain_and_name.py | eugene94/IG_clone | 6a525524ec357d5617b09e013b449df2ec9336ad | [
"MIT"
] | null | null | null | instagram_clone/contrib/sites/migrations/0003_set_site_domain_and_name.py | eugene94/IG_clone | 6a525524ec357d5617b09e013b449df2ec9336ad | [
"MIT"
] | null | null | null | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site d... | 28.942857 | 129 | 0.687068 | from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
Site = apps.get_model("sites", "Site")
Site.objects.update_or_create(
id=settings.SITE_ID,
defaults={
"domain": "jinseong.co",
"name": "instagram-clone",
... | true | true |
f762d362f077648d6092ca421c6a397f0f3871dd | 1,268 | py | Python | data/spm/generate_corpus.py | tarohi24/docsim | 4879bcc889c32470a27094eb183c2ce15ae2f1fb | [
"MIT"
] | 1 | 2020-04-29T13:52:29.000Z | 2020-04-29T13:52:29.000Z | data/spm/generate_corpus.py | tarohi24/docsim | 4879bcc889c32470a27094eb183c2ce15ae2f1fb | [
"MIT"
] | 136 | 2019-09-19T03:36:21.000Z | 2019-11-28T08:50:45.000Z | data/spm/generate_corpus.py | tarohi24/docsim | 4879bcc889c32470a27094eb183c2ce15ae2f1fb | [
"MIT"
] | null | null | null | """
Generate corpus for the specific category
"""
import argparse
from pathlib import Path
from typing import List
from tqdm import tqdm
from docsim.elas.search import EsResult, EsSearcher
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('dataset',
ty... | 28.177778 | 82 | 0.584385 | import argparse
from pathlib import Path
from typing import List
from tqdm import tqdm
from docsim.elas.search import EsResult, EsSearcher
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('dataset',
type=str,
nargs=1)
parse... | true | true |
f762d3c7e1b4682a710486ebf71e6d8d3d5d7fbe | 6,590 | py | Python | hapcolor.py | rebeccaserramari/Kyoshi | 8a26a73735fac9c4ea13c297633a6c8302811c9b | [
"MIT"
] | null | null | null | hapcolor.py | rebeccaserramari/Kyoshi | 8a26a73735fac9c4ea13c297633a6c8302811c9b | [
"MIT"
] | null | null | null | hapcolor.py | rebeccaserramari/Kyoshi | 8a26a73735fac9c4ea13c297633a6c8302811c9b | [
"MIT"
] | null | null | null | """
Colouring chromosomes by ancestries inferred by a reference panel
"""
from __future__ import absolute_import
import logging
from utils import compute_referencepanel, compute_haplotypes
import sys
import argparse
from cyvcf2 import VCF, Writer
import platform
import resource
import random
from core import hmm
from ... | 33.451777 | 162 | 0.721396 | from __future__ import absolute_import
import logging
from utils import compute_referencepanel, compute_haplotypes
import sys
import argparse
from cyvcf2 import VCF, Writer
import platform
import resource
import random
from core import hmm
from collections import defaultdict
from operator import itemgetter
logger = l... | true | true |
f762d437527da36b9b3d5b2685c1e0a8f2667478 | 187 | py | Python | easy_tk/__init__.py | uros-5/easy-tk | 35426abf56ad1c7729f05619835419c819c4637b | [
"MIT"
] | 1 | 2021-02-16T21:25:51.000Z | 2021-02-16T21:25:51.000Z | easy_tk/__init__.py | uros-5/easy-tk | 35426abf56ad1c7729f05619835419c819c4637b | [
"MIT"
] | null | null | null | easy_tk/__init__.py | uros-5/easy-tk | 35426abf56ad1c7729f05619835419c819c4637b | [
"MIT"
] | null | null | null | from easy_tk.TkMaster import TkMaster
from easy_tk.TkChild import TkChild
from easy_tk.helpers import *
from easy_tk.EasyTk import EasyTk
from easy_tk.EasyTkObject import EasyTkObject | 37.4 | 45 | 0.84492 | from easy_tk.TkMaster import TkMaster
from easy_tk.TkChild import TkChild
from easy_tk.helpers import *
from easy_tk.EasyTk import EasyTk
from easy_tk.EasyTkObject import EasyTkObject | true | true |
f762d51d87e2c2b94eb20189ddd2e600af9bec33 | 9,240 | py | Python | unittest/unittest.py | pfalcon/pycopy-lib | 087d99d872f4df732924d115d2724b44fefc1262 | [
"PSF-2.0"
] | 126 | 2019-07-19T14:42:41.000Z | 2022-03-21T22:22:19.000Z | unittest/unittest.py | pfalcon/pycopy-lib | 087d99d872f4df732924d115d2724b44fefc1262 | [
"PSF-2.0"
] | 38 | 2019-08-28T01:46:31.000Z | 2022-03-17T05:46:51.000Z | unittest/unittest.py | pfalcon/pycopy-lib | 087d99d872f4df732924d115d2724b44fefc1262 | [
"PSF-2.0"
] | 55 | 2019-08-02T09:32:33.000Z | 2021-12-22T11:25:51.000Z | import sys
try:
import io
import traceback
except ImportError:
import uio as io
traceback = None
class SkipTest(Exception):
pass
class AssertRaisesContext:
def __init__(self, exc):
self.expected = exc
def __enter__(self):
return self
def __exit__(self, exc_type, ex... | 26.551724 | 91 | 0.505628 | import sys
try:
import io
import traceback
except ImportError:
import uio as io
traceback = None
class SkipTest(Exception):
pass
class AssertRaisesContext:
def __init__(self, exc):
self.expected = exc
def __enter__(self):
return self
def __exit__(self, exc_type, ex... | true | true |
f762d5b6d0e9e2602ef5a28068a4cc339c6d1486 | 8,620 | py | Python | fetcher/proxyFetcher.py | KyoMio/proxy_pool | 5e643867a99d6ea0076700e2e7754e520dea133a | [
"MIT"
] | null | null | null | fetcher/proxyFetcher.py | KyoMio/proxy_pool | 5e643867a99d6ea0076700e2e7754e520dea133a | [
"MIT"
] | null | null | null | fetcher/proxyFetcher.py | KyoMio/proxy_pool | 5e643867a99d6ea0076700e2e7754e520dea133a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: proxyFetcher
Description :
Author : JHao
date: 2016/11/25
-------------------------------------------------
Change Activity:
2016/11/25: proxyFetcher
---------------------------... | 36.371308 | 131 | 0.478306 | __author__ = 'JHao'
import json
import re
from time import sleep
from util.webRequest import WebRequest
class ProxyFetcher(object):
@staticmethod
def freeProxy01():
url_list = [
'https://proxy.mimvp.com/freeopen?proxy=in_hp',
'https://proxy.mimvp.com/freeopen?proxy=out_hp'
... | true | true |
f762d6807a00bd58ca4de7c8667a95908d014a66 | 24,972 | py | Python | benchmarks/Python/cd.py | OvermindDL1/are-we-fast-yet | 78b0560c7c3b7a90b22b90c4cb27660e56478d30 | [
"BSD-3-Clause"
] | null | null | null | benchmarks/Python/cd.py | OvermindDL1/are-we-fast-yet | 78b0560c7c3b7a90b22b90c4cb27660e56478d30 | [
"BSD-3-Clause"
] | null | null | null | benchmarks/Python/cd.py | OvermindDL1/are-we-fast-yet | 78b0560c7c3b7a90b22b90c4cb27660e56478d30 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2001-2021 Stefan Marr
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, di... | 30.416565 | 100 | 0.531435 | from enum import Enum
from math import sqrt, cos, sin
from benchmark import Benchmark
from som.vector import Vector
MIN_X = 0.0
MIN_Y = 0.0
MAX_X = 1000.0
MAX_Y = 1000.0
MIN_Z = 0.0
MAX_Z = 10.0
PROXIMITY_RADIUS = 1.0
GOOD_VOXEL_SIZE = PROXIMITY_RADIUS * 2.0
def _compare_numbers(a, b):
if a == b:
return... | true | true |
f762d69ad0f38b5bdf69289e95d3596b3e9eceb6 | 7,333 | py | Python | fn_ldap_utilities/fn_ldap_utilities/components/ldap_utilities_search.py | nickpartner-goahead/resilient-community-apps | 097c0dbefddbd221b31149d82af9809420498134 | [
"MIT"
] | 65 | 2017-12-04T13:58:32.000Z | 2022-03-24T18:33:17.000Z | fn_ldap_utilities/fn_ldap_utilities/components/ldap_utilities_search.py | nickpartner-goahead/resilient-community-apps | 097c0dbefddbd221b31149d82af9809420498134 | [
"MIT"
] | 48 | 2018-03-02T19:17:14.000Z | 2022-03-09T22:00:38.000Z | fn_ldap_utilities/fn_ldap_utilities/components/ldap_utilities_search.py | nickpartner-goahead/resilient-community-apps | 097c0dbefddbd221b31149d82af9809420498134 | [
"MIT"
] | 95 | 2018-01-11T16:23:39.000Z | 2022-03-21T11:34:29.000Z | # -*- coding: utf-8 -*-
# (c) Copyright IBM Corp. 2018. All Rights Reserved.
# pragma pylint: disable=unused-argument, no-self-use, line-too-long
""" Resilient functions component to execute queries against an LDAP server """
import logging
import json
import re
from resilient_circuits import ResilientComponent, func... | 42.883041 | 178 | 0.623483 |
import logging
import json
import re
from resilient_circuits import ResilientComponent, function, handler, StatusMessage, FunctionResult, FunctionError
from ldap3 import ALL_ATTRIBUTES
from ldap3.core.exceptions import LDAPSocketOpenError
from ldap3.utils.conv import escape_filter_chars
from fn_ldap_utilities.util.he... | true | true |
f762d6bffc29bd8ad663e1488213cf614dfbd5ee | 251 | py | Python | flowchart/__init__.py | alphaserv-computing-solutions/python-flowchart | 3fed89b86601e5c78ce8192f37346e770acf0e97 | [
"Apache-2.0"
] | null | null | null | flowchart/__init__.py | alphaserv-computing-solutions/python-flowchart | 3fed89b86601e5c78ce8192f37346e770acf0e97 | [
"Apache-2.0"
] | null | null | null | flowchart/__init__.py | alphaserv-computing-solutions/python-flowchart | 3fed89b86601e5c78ce8192f37346e770acf0e97 | [
"Apache-2.0"
] | null | null | null | """flowchart
Flowchart Library in Python
Copyright 2016 AlphaServ Computing Solutions
"""
from flowchart.chart import FlowChart
from flowchart.version import __version__, __version_info__
__all__ = ['FlowChart', '__version__', '__version_info__']
| 20.916667 | 59 | 0.804781 |
from flowchart.chart import FlowChart
from flowchart.version import __version__, __version_info__
__all__ = ['FlowChart', '__version__', '__version_info__']
| true | true |
f762d70b08c14f657c69e9d89fd31e8700433295 | 25,434 | py | Python | astropy/utils/data_info.py | mehrdad-shokri/astropy | abd73b51277694338c8eca7639da956dcd06f207 | [
"BSD-3-Clause"
] | null | null | null | astropy/utils/data_info.py | mehrdad-shokri/astropy | abd73b51277694338c8eca7639da956dcd06f207 | [
"BSD-3-Clause"
] | null | null | null | astropy/utils/data_info.py | mehrdad-shokri/astropy | abd73b51277694338c8eca7639da956dcd06f207 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""This module contains functions and methods that relate to the DataInfo class
which provides a container for informational attributes as well as summary info
methods.
A DataInfo object is attached to the Quantity, SkyCoord, and ... | 34.984869 | 133 | 0.607887 |
import os
import re
import sys
import weakref
import warnings
from io import StringIO
from copy import deepcopy
from functools import partial
from collections import OrderedDict
from contextlib import contextmanager
import numpy as np
from . import metadata
__all__ = ['data_info_factory', 'dtype_info_name', 'Ba... | true | true |
f762da9743019061a60620d7b40b2309cf39a56a | 699 | py | Python | lasers_gui.py | MaxP92/python-Tsunami-Vanguard | 5cd55f2c04b8ac66047d3281347b3c9324f5e16b | [
"MIT"
] | null | null | null | lasers_gui.py | MaxP92/python-Tsunami-Vanguard | 5cd55f2c04b8ac66047d3281347b3c9324f5e16b | [
"MIT"
] | null | null | null | lasers_gui.py | MaxP92/python-Tsunami-Vanguard | 5cd55f2c04b8ac66047d3281347b3c9324f5e16b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon July 24 16:35:13 2017
@author: Maxime PINSARD
"""
import os, sys
os.chdir('C:/Users/admin/Documents/Python/Lasers GUI standalone')
from PyQt5 import QtWidgets
import lasers_core2
if __name__=='__main__':
# just to avoid pyqt5 to quit when ... | 24.103448 | 66 | 0.643777 | import os, sys
os.chdir('C:/Users/admin/Documents/Python/Lasers GUI standalone')
from PyQt5 import QtWidgets
import lasers_core2
if __name__=='__main__':
def my_excepthook(type, value, tback):
sys.__excepthook__(type, value, tback)
sys.excepthook = ... | true | true |
f762dac679c14f9bdf85762af4aad0b2cb600acc | 383 | py | Python | app/email.py | evantoh/one-minute-pitch | ca79dd1b77c0a2039e58d9cdb2b1fcb4ac285afb | [
"Unlicense"
] | null | null | null | app/email.py | evantoh/one-minute-pitch | ca79dd1b77c0a2039e58d9cdb2b1fcb4ac285afb | [
"Unlicense"
] | null | null | null | app/email.py | evantoh/one-minute-pitch | ca79dd1b77c0a2039e58d9cdb2b1fcb4ac285afb | [
"Unlicense"
] | null | null | null | from flask_mail import Message
from flask import render_template
from . import mail
def mail_message(subject,template,to,**kwargs):
sender_email = evanmwenda@gmail.com
email = Message(subject, sender=sender_email, recipients=[to])
email.body= render_template(template + ".txt",**kwargs)
email.html = re... | 34.818182 | 66 | 0.741514 | from flask_mail import Message
from flask import render_template
from . import mail
def mail_message(subject,template,to,**kwargs):
sender_email = evanmwenda@gmail.com
email = Message(subject, sender=sender_email, recipients=[to])
email.body= render_template(template + ".txt",**kwargs)
email.html = re... | true | true |
f762db9a811094b680856254e465286e8da9d183 | 32,670 | py | Python | treecorr/binnedcorr3.py | zchvsre/TreeCorr | 825dc0a9d4754f9d98ebcf9c26dee9597915d650 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | treecorr/binnedcorr3.py | zchvsre/TreeCorr | 825dc0a9d4754f9d98ebcf9c26dee9597915d650 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | treecorr/binnedcorr3.py | zchvsre/TreeCorr | 825dc0a9d4754f9d98ebcf9c26dee9597915d650 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-12-14T16:23:33.000Z | 2020-12-14T16:23:33.000Z | # Copyright (c) 2003-2019 by Mike Jarvis
#
# TreeCorr is free software: redistribution and use in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condi... | 57.41652 | 103 | 0.586134 |
import math
import numpy as np
import sys
import coord
import treecorr
class BinnedCorr3(object):
_valid_params = {
'nbins' : (int, False, None, None,
'The number of output bins to use for sep dimension.'),
'bin_size' : (float, False, None, None,
'The size of the o... | true | true |
f762dc7a42663ce4b4a88ab6ff50a2fa3f55a05a | 3,235 | py | Python | bindings/python/tokenizers/implementations/byte_level_bpe.py | llogiq/tokenizers | 2a4e5f81de507d0d32e7c44786743a4c939e1b51 | [
"Apache-2.0"
] | null | null | null | bindings/python/tokenizers/implementations/byte_level_bpe.py | llogiq/tokenizers | 2a4e5f81de507d0d32e7c44786743a4c939e1b51 | [
"Apache-2.0"
] | null | null | null | bindings/python/tokenizers/implementations/byte_level_bpe.py | llogiq/tokenizers | 2a4e5f81de507d0d32e7c44786743a4c939e1b51 | [
"Apache-2.0"
] | null | null | null | from tokenizers import Tokenizer, AddedToken, pre_tokenizers, decoders, trainers, processors
from tokenizers.models import BPE
from tokenizers.normalizers import unicode_normalizer_from_str, Lowercase, Sequence
from .base_tokenizer import BaseTokenizer
from typing import Optional, List, Union
class ByteLevelBPEToken... | 34.784946 | 93 | 0.619165 | from tokenizers import Tokenizer, AddedToken, pre_tokenizers, decoders, trainers, processors
from tokenizers.models import BPE
from tokenizers.normalizers import unicode_normalizer_from_str, Lowercase, Sequence
from .base_tokenizer import BaseTokenizer
from typing import Optional, List, Union
class ByteLevelBPEToken... | true | true |
f762dc8d6f95f566b6e52883a1e520d9ccd683f3 | 984 | py | Python | tests/components/climacell/conftest.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | tests/components/climacell/conftest.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | tests/components/climacell/conftest.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Configure py.test."""
import json
from unittest.mock import patch
import pytest
from tests.common import load_fixture
@pytest.fixture(name="climacell_config_entry_update")
def climacell_config_entry_update_fixture():
"""Mock valid climacell config entry setup."""
with patch(
"homeassistant.compon... | 36.444444 | 87 | 0.731707 | import json
from unittest.mock import patch
import pytest
from tests.common import load_fixture
@pytest.fixture(name="climacell_config_entry_update")
def climacell_config_entry_update_fixture():
with patch(
"homeassistant.components.climacell.ClimaCellV3.realtime",
return_value=json.loads(load_f... | true | true |
f762dcf415ce798f49b2538421ccc0bd9c416048 | 4,499 | bzl | Python | toolchains/lib/assets.bzl | cgrindel/bazel-starlib | 17430b0574da13a01ab49f3bc24eea66b29c7905 | [
"Apache-2.0"
] | 9 | 2021-11-02T22:29:57.000Z | 2022-02-18T00:16:10.000Z | toolchains/lib/assets.bzl | cgrindel/bazel-starlib | 17430b0574da13a01ab49f3bc24eea66b29c7905 | [
"Apache-2.0"
] | 42 | 2021-12-06T18:28:36.000Z | 2022-03-29T16:44:51.000Z | toolchains/lib/assets.bzl | cgrindel/bazel-starlib | 17430b0574da13a01ab49f3bc24eea66b29c7905 | [
"Apache-2.0"
] | null | null | null | """Utility functions for managing asset structs."""
load("@bazel_skylib//lib:types.bzl", "types")
_TYPICAL_PLATFORMS = ["darwin", "linux"]
_TYPICAL_ARCHES = ["amd64", "arm64"]
def _create(name, platform, arch, version, sha256 = None):
"""Create a `struct` representing a buildtools asset.
Args:
name:... | 32.135714 | 113 | 0.590353 |
load("@bazel_skylib//lib:types.bzl", "types")
_TYPICAL_PLATFORMS = ["darwin", "linux"]
_TYPICAL_ARCHES = ["amd64", "arm64"]
def _create(name, platform, arch, version, sha256 = None):
if name == None:
fail("Expected a name.")
if platform == None:
fail("Expected a platform.")
if arch == Non... | true | true |
f762dd335c9fb98fada53fe11609b8203c178d44 | 9,821 | py | Python | tests/unit/test_pillar.py | nevins-b/salt | 56363bc41ca36e757103df3504d1bb07e3a7251b | [
"Apache-2.0"
] | null | null | null | tests/unit/test_pillar.py | nevins-b/salt | 56363bc41ca36e757103df3504d1bb07e3a7251b | [
"Apache-2.0"
] | null | null | null | tests/unit/test_pillar.py | nevins-b/salt | 56363bc41ca36e757103df3504d1bb07e3a7251b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
tests.unit.pillar_test
~~~~~~~~~~~~~~~~~~~~~~
'''
# Import python libs
from __future__ import absolute_import
import tempfile
# Import Salt Testing libs
from tests.support.unit import skipIf, TestCase
from tests.support... | 31.376997 | 107 | 0.537827 |
from __future__ import absolute_import
import tempfile
from tests.support.unit import skipIf, TestCase
from tests.support.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
import salt.pillar
@skipIf(NO_MOCK, NO_MOCK_REASON)
class PillarTestCase(TestCase):
def tearDown(self):
for attrname in ('gene... | true | true |
f762deced8d3b24921c6217ce2f2196249c0bd54 | 5,414 | py | Python | script/test.py | radar155/electron | bc7ceb7c346d0b6b23663a290247b2ca0bc96fbf | [
"MIT"
] | 3 | 2018-11-24T00:07:21.000Z | 2021-06-01T17:14:27.000Z | script/test.py | hamdyelbatal122/electron | a8a881c8dbbd8b8f0fec5c59d72a9f1e66bbd09d | [
"MIT"
] | 2 | 2021-09-02T14:16:14.000Z | 2022-01-22T13:18:55.000Z | script/test.py | hamdyelbatal122/electron | a8a881c8dbbd8b8f0fec5c59d72a9f1e66bbd09d | [
"MIT"
] | 1 | 2019-02-09T09:00:23.000Z | 2019-02-09T09:00:23.000Z | #!/usr/bin/env python
import argparse
import atexit
import os
import shutil
import subprocess
import sys
from lib.config import enable_verbose_mode
from lib.util import get_electron_branding, execute_stdout, rm_rf
import lib.dbus_mock
if sys.platform == 'linux2':
# On Linux we use python-dbusmock to create a fa... | 36.093333 | 79 | 0.640192 |
import argparse
import atexit
import os
import shutil
import subprocess
import sys
from lib.config import enable_verbose_mode
from lib.util import get_electron_branding, execute_stdout, rm_rf
import lib.dbus_mock
if sys.platform == 'linux2':
try:
lib.dbus_mock.start()
atexit.... | false | true |
f762dee7bc57dc88a4fb3f7d1b7c90fbc09f95ee | 799 | py | Python | src/application/handlers/events.py | jorzel/opentable | 712182ae7ca39cda601d0c9e14a28b56794dc2dd | [
"MIT"
] | 9 | 2021-02-23T13:49:11.000Z | 2022-03-27T20:52:16.000Z | src/application/handlers/events.py | jorzel/opentable | 712182ae7ca39cda601d0c9e14a28b56794dc2dd | [
"MIT"
] | null | null | null | src/application/handlers/events.py | jorzel/opentable | 712182ae7ca39cda601d0c9e14a28b56794dc2dd | [
"MIT"
] | null | null | null | import logging
from typing import Any, Dict, List
from domain.events.table import DomainEvent
logger = logging.getLogger(__name__)
def handle_events(
handlers: Dict[DomainEvent, Any], events: List[Dict[str, Any]]
) -> List[str]:
"""
Primary port defining how incoming events are handled.
`handlers` -... | 29.592593 | 88 | 0.644556 | import logging
from typing import Any, Dict, List
from domain.events.table import DomainEvent
logger = logging.getLogger(__name__)
def handle_events(
handlers: Dict[DomainEvent, Any], events: List[Dict[str, Any]]
) -> List[str]:
handled = []
for event in events:
handler = handlers.get(event["nam... | true | true |
f762df008c2e5282c4e0b3d76632c4351cfae083 | 4,647 | py | Python | covidframe/config/__init__.py | covid-frame/covid-frame | 32d50cafa3ba3388cd44cdb49136727b870def62 | [
"Apache-2.0"
] | null | null | null | covidframe/config/__init__.py | covid-frame/covid-frame | 32d50cafa3ba3388cd44cdb49136727b870def62 | [
"Apache-2.0"
] | null | null | null | covidframe/config/__init__.py | covid-frame/covid-frame | 32d50cafa3ba3388cd44cdb49136727b870def62 | [
"Apache-2.0"
] | null | null | null | import os
from dotenv import load_dotenv
load_dotenv()
paths = {
"datasets_base_path": os.getenv("DATASETS_BASE_PATH", "."),
"output_folder": os.getenv("OUTPUT_FOLDER", ".")
}
categories = [
"pneumonia",
"normal",
"covid-19"
]
databases = [
{
"type": "metadata",
"source": "gi... | 30.572368 | 71 | 0.462449 | import os
from dotenv import load_dotenv
load_dotenv()
paths = {
"datasets_base_path": os.getenv("DATASETS_BASE_PATH", "."),
"output_folder": os.getenv("OUTPUT_FOLDER", ".")
}
categories = [
"pneumonia",
"normal",
"covid-19"
]
databases = [
{
"type": "metadata",
"source": "gi... | true | true |
f762df0f3df5a5e6a417c4593f835160f4cda0e1 | 6,975 | py | Python | venv/lib/python2.7/site-packages/ansible/modules/windows/win_certificate_store.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 37 | 2017-08-15T15:02:43.000Z | 2021-07-23T03:44:31.000Z | venv/lib/python2.7/site-packages/ansible/modules/windows/win_certificate_store.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 12 | 2018-01-10T05:25:25.000Z | 2021-11-28T06:55:48.000Z | venv/lib/python2.7/site-packages/ansible/modules/windows/win_certificate_store.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 49 | 2017-08-15T09:52:13.000Z | 2022-03-21T17:11:54.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCU... | 36.904762 | 124 | 0.718423 |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: win_certificate_store
version_added: '2.5'
short_description: Manages the certificate store
description:
- Used to import/export and remove certi... | true | true |
f762e09bcca7a7b628a67609809e06bd20a75603 | 733 | py | Python | Set09/tests/dags/chapter9/custom/test_operators_incorrect.py | atingupta2005/airflow-examples | cb3b2baebb4716d27a53947680e0b5ac7150970f | [
"BSD-Source-Code"
] | null | null | null | Set09/tests/dags/chapter9/custom/test_operators_incorrect.py | atingupta2005/airflow-examples | cb3b2baebb4716d27a53947680e0b5ac7150970f | [
"BSD-Source-Code"
] | null | null | null | Set09/tests/dags/chapter9/custom/test_operators_incorrect.py | atingupta2005/airflow-examples | cb3b2baebb4716d27a53947680e0b5ac7150970f | [
"BSD-Source-Code"
] | null | null | null | from airflow.hooks.base_hook import BaseHook
from airflow.models import Connection
from pytest_mock import MockFixture
from airfloweset.operators.movielens_operator import MovielensPopularityOperator
def test_movielenspopularityoperator(mocker: MockFixture):
mock_get = mocker.patch.object(
BaseHook,
... | 30.541667 | 85 | 0.710778 | from airflow.hooks.base_hook import BaseHook
from airflow.models import Connection
from pytest_mock import MockFixture
from airfloweset.operators.movielens_operator import MovielensPopularityOperator
def test_movielenspopularityoperator(mocker: MockFixture):
mock_get = mocker.patch.object(
BaseHook,
... | true | true |
f762e1901d492a52f1807efd2abefb0013f7295a | 96 | py | Python | api_digital_certificate/digital_api/apps.py | slarda/Web-Scrapping-Bots-For-Crawling-Docs | aa8ce3c72bfbe2111d16655ffc3a6759a825946e | [
"Apache-2.0"
] | 1 | 2020-12-17T11:21:01.000Z | 2020-12-17T11:21:01.000Z | api_digital_certificate/digital_api/apps.py | soft-super/Web-Scrapping-Bots-For-Crawling-Docs | aa8ce3c72bfbe2111d16655ffc3a6759a825946e | [
"Apache-2.0"
] | 5 | 2021-03-19T01:48:07.000Z | 2021-06-09T18:26:31.000Z | api_digital_certificate/digital_api/apps.py | tiny-1996/Web-Scrapping-Bots-For-Crawling-Docs | aa8ce3c72bfbe2111d16655ffc3a6759a825946e | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class DigitalApiConfig(AppConfig):
name = 'digital_api'
| 16 | 34 | 0.770833 | from django.apps import AppConfig
class DigitalApiConfig(AppConfig):
name = 'digital_api'
| true | true |
f762e2e085f69fc6622748965d37ff4360b5c196 | 2,688 | py | Python | features/feature_generator.py | jmrozanec/features-generator | 0772394cf1c4a56a88c8a8faba2e5c84b4b2883f | [
"Apache-2.0"
] | 3 | 2018-07-19T14:37:37.000Z | 2021-06-03T12:44:22.000Z | features/feature_generator.py | jmrozanec/features-generator | 0772394cf1c4a56a88c8a8faba2e5c84b4b2883f | [
"Apache-2.0"
] | null | null | null | features/feature_generator.py | jmrozanec/features-generator | 0772394cf1c4a56a88c8a8faba2e5c84b4b2883f | [
"Apache-2.0"
] | 2 | 2020-02-22T20:14:48.000Z | 2020-12-03T19:42:03.000Z | from sklearn.base import BaseEstimator, TransformerMixin
from feature_generation_strategy import MinFeatureGenerationStrategy, MaxFeatureGenerationStrategy, SumFeatureGenerationStrategy, DiffFeatureGenerationStrategy, ProdFeatureGenerationStrategy, DivFeatureGenerationStrategy, AvgFeatureGenerationStrategy, PCAFeatureG... | 37.859155 | 401 | 0.787946 | from sklearn.base import BaseEstimator, TransformerMixin
from feature_generation_strategy import MinFeatureGenerationStrategy, MaxFeatureGenerationStrategy, SumFeatureGenerationStrategy, DiffFeatureGenerationStrategy, ProdFeatureGenerationStrategy, DivFeatureGenerationStrategy, AvgFeatureGenerationStrategy, PCAFeatureG... | true | true |
f762e2ef2df2451ee2d32934f03d14e35d1c078c | 2,399 | py | Python | src/secondaires/navigation/elements/amarre.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/secondaires/navigation/elements/amarre.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/secondaires/navigation/elements/amarre.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | # -*-coding:Utf-8 -*
# Copyright (c) 2012 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# l... | 40.661017 | 79 | 0.724469 |
from bases.objet.attribut import Attribut
from secondaires.navigation.constantes import *
from .base import BaseElement
class Amarre(BaseElement):
nom_type = "amarre"
def __init__(self, cle=""):
BaseElement.__init__(self, cle)
self._attributs = {
"attachee... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.