hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
268dcfcbfe53d8ec28133e7e8904518da9a4d49f | 409 | py | Python | plugins/dashboard/widgets/uptime.py | ajenti/ajen | 177c1a67278a7763ed06eb2f773d7b409a85ec77 | [
"MIT"
] | 3,777 | 2015-02-21T00:10:12.000Z | 2022-03-30T15:33:22.000Z | plugins/dashboard/widgets/uptime.py | ajenti/ajen | 177c1a67278a7763ed06eb2f773d7b409a85ec77 | [
"MIT"
] | 749 | 2015-03-12T14:17:03.000Z | 2022-03-25T13:22:28.000Z | plugins/dashboard/widgets/uptime.py | ajenti/ajen | 177c1a67278a7763ed06eb2f773d7b409a85ec77 | [
"MIT"
] | 687 | 2015-03-21T10:42:33.000Z | 2022-03-21T23:18:12.000Z | import psutil
import time
from jadi import component
from aj.plugins.dashboard.api import Widget
@component(Widget)
class UptimeWidget(Widget):
id = 'uptime'
name = _('Uptime')
template = '/dashboard:resources/partial/widgets/uptime.html'
def __init__(self, context):
Widget.__init__(self, co... | 21.526316 | 65 | 0.701711 |
4fcea72a447ec14238b0be6de48a6d11dcb3ae59 | 3,209 | py | Python | lark/parsers/lalr_puppet.py | julienmalard/lark | a768506945a56ed1503cba230fb79d7beaa4dacf | [
"MIT"
] | null | null | null | lark/parsers/lalr_puppet.py | julienmalard/lark | a768506945a56ed1503cba230fb79d7beaa4dacf | [
"MIT"
] | null | null | null | lark/parsers/lalr_puppet.py | julienmalard/lark | a768506945a56ed1503cba230fb79d7beaa4dacf | [
"MIT"
] | null | null | null | # This module provide a LALR puppet, which is used to debugging and error handling
from copy import deepcopy
from .lalr_analysis import Shift, Reduce
from .. import Token
class ParserPuppet(object):
def __init__(self, parser, state_stack, value_stack, start, stream, set_state):
self.parser = parser
... | 30.273585 | 114 | 0.571518 |
aab89020ea8022bc6136476bddb62d2686374c50 | 527 | py | Python | testgear/HPAK/B2902A.py | PhilippCo/testgear | 9dbf9c6e1028394375ccca6720d5be1854315f93 | [
"MIT"
] | 1 | 2021-08-25T15:16:57.000Z | 2021-08-25T15:16:57.000Z | testgear/HPAK/B2902A.py | PhilippCo/testgear | 9dbf9c6e1028394375ccca6720d5be1854315f93 | [
"MIT"
] | null | null | null | testgear/HPAK/B2902A.py | PhilippCo/testgear | 9dbf9c6e1028394375ccca6720d5be1854315f93 | [
"MIT"
] | null | null | null | """Agilent B2902A Precision Source/Measure Unit"""
import testgear.base_classes as base
import numpy as np
class B2902A(base.source):
def init(self):
self.set_timeout(10)
self.idstr = self.query("*IDN?").strip()
def set_output(self, voltage=None, current=None, enabled=True, frequency=0, ... | 27.736842 | 124 | 0.667932 |
3519467e6227b676c514ed7c97cc8c3251178ad7 | 569 | py | Python | src/meta_bilstm/nn_utils/losses.py | brongulus/MetaBiLSTM | ca70c96fa375cb7e4ca5a4199395e6fe00ce6ed3 | [
"MIT"
] | null | null | null | src/meta_bilstm/nn_utils/losses.py | brongulus/MetaBiLSTM | ca70c96fa375cb7e4ca5a4199395e6fe00ce6ed3 | [
"MIT"
] | null | null | null | src/meta_bilstm/nn_utils/losses.py | brongulus/MetaBiLSTM | ca70c96fa375cb7e4ca5a4199395e6fe00ce6ed3 | [
"MIT"
] | null | null | null | import torch.nn.functional as F
def seq_loss(inp, lens, labels):
"""Calculate the cross entropy loss"""
total_loss = 0
for i in range(len(inp)):
total_loss += F.cross_entropy(
inp[i, : lens[i], :], labels[i][: lens[i]], reduction="sum"
)
return total_loss / sum(lens)
def ... | 28.45 | 71 | 0.620387 |
ee0a363d9df28a3a1f772b5d50155674ba34485c | 92 | py | Python | backend/gifz_api/gifs/apps.py | mkusiciel/terraform-workshops | 52fd795cbd4e2b180dc7729cefe69cde40a50abf | [
"MIT"
] | 3 | 2018-04-14T08:30:56.000Z | 2018-06-30T06:56:00.000Z | backend/gifz_api/gifs/apps.py | 0mk1/terraform-workshops | 689ed933bbffa90dd49cd2bc5617a971cb2c5e37 | [
"MIT"
] | 1 | 2018-06-30T07:08:09.000Z | 2018-06-30T07:08:09.000Z | backend/gifz_api/gifs/apps.py | 0mk1/terraform-workshops | 689ed933bbffa90dd49cd2bc5617a971cb2c5e37 | [
"MIT"
] | 3 | 2018-04-14T10:41:59.000Z | 2019-11-10T21:27:43.000Z | from django.apps import AppConfig
class GifsConfig(AppConfig):
name = 'gifz_api.gifs'
| 15.333333 | 33 | 0.75 |
fcee9b6c51f2cf8eb34ed440803d5a73c7fdb63c | 5,629 | py | Python | dae_ecgsim.py | lingfliu/sfnn | e747bdcf964ec2395165cebb547981e73761457b | [
"Apache-2.0"
] | 1 | 2019-11-13T05:34:32.000Z | 2019-11-13T05:34:32.000Z | dae_ecgsim.py | lingfliu/sfnn | e747bdcf964ec2395165cebb547981e73761457b | [
"Apache-2.0"
] | null | null | null | dae_ecgsim.py | lingfliu/sfnn | e747bdcf964ec2395165cebb547981e73761457b | [
"Apache-2.0"
] | null | null | null | from keras.layers import ConvLSTM2D, Dense, Conv1D, TimeDistributed, BatchNormalization, MaxPooling2D, MaxPooling1D
from keras.layers import Bidirectional, CuDNNLSTM, Dropout, LSTM, Add, Conv2D, Multiply
from keras.layers import Reshape, Input, Flatten, BatchNormalization
from keras.models import Model
import keras
''... | 29.471204 | 158 | 0.70652 |
f6c7997c4df60254984c0423624d2489218edb15 | 10,664 | py | Python | tests/common/custom_cluster_test_suite.py | radford-nguyen/impala | eb95c912cb7e720caf66388942b4e94d95e95658 | [
"Apache-2.0"
] | null | null | null | tests/common/custom_cluster_test_suite.py | radford-nguyen/impala | eb95c912cb7e720caf66388942b4e94d95e95658 | [
"Apache-2.0"
] | null | null | null | tests/common/custom_cluster_test_suite.py | radford-nguyen/impala | eb95c912cb7e720caf66388942b4e94d95e95658 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 43.526531 | 90 | 0.73434 |
1ed95c3456e8611191b93300cff78493cca0c089 | 4,257 | py | Python | models/pointnet_cls.py | aviros/pointnet_totations | 3b6deac9fb2445776ce91c6fcf37b8ec9d497a1b | [
"MIT"
] | null | null | null | models/pointnet_cls.py | aviros/pointnet_totations | 3b6deac9fb2445776ce91c6fcf37b8ec9d497a1b | [
"MIT"
] | null | null | null | models/pointnet_cls.py | aviros/pointnet_totations | 3b6deac9fb2445776ce91c6fcf37b8ec9d497a1b | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import math
import sys
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, '../utils'))
import tf_util
from transform_nets import input_transform_net, feature_transform_net
def placeholder_inputs(bat... | 43 | 97 | 0.63284 |
72dc2ab7a61976b4903e7d4c332dd5b27cf19fc0 | 1,578 | py | Python | hail/python/hailtop/hail_logging.py | mitochon/hail | 25e5e5b8da1d978468d2cee393426ade46484a87 | [
"MIT"
] | null | null | null | hail/python/hailtop/hail_logging.py | mitochon/hail | 25e5e5b8da1d978468d2cee393426ade46484a87 | [
"MIT"
] | 3 | 2017-06-16T18:10:45.000Z | 2017-07-21T17:44:13.000Z | hail/python/hailtop/hail_logging.py | mitochon/hail | 25e5e5b8da1d978468d2cee393426ade46484a87 | [
"MIT"
] | 2 | 2018-01-30T00:50:52.000Z | 2018-03-22T20:04:01.000Z | import logging
from pythonjsonlogger import jsonlogger
from aiohttp.abc import AbstractAccessLogger
import datetime
import time
class CustomJsonFormatter(jsonlogger.JsonFormatter):
def add_fields(self, log_record, record, message_dict):
super().add_fields(log_record, record, message_dict)
log_reco... | 41.526316 | 93 | 0.651458 |
8d23bd4e6ce9e9a3d65d593849058b5b9a11799f | 9,651 | py | Python | hackerrank/euler009/euler009_brute.py | jcpince/algorithms | c43dd8e98a0f0df691ead5f25c2c17a9241db908 | [
"MIT"
] | null | null | null | hackerrank/euler009/euler009_brute.py | jcpince/algorithms | c43dd8e98a0f0df691ead5f25c2c17a9241db908 | [
"MIT"
] | null | null | null | hackerrank/euler009/euler009_brute.py | jcpince/algorithms | c43dd8e98a0f0df691ead5f25c2c17a9241db908 | [
"MIT"
] | null | null | null | pythagoreans = {2560: 534773760, 1026: 38372400, 2052: 306979200, 2080: 304711680, 1032: 38163360, 2220: 379897500, 2728: 721337760, 12: 60, 2050: 260071200, 1040: 38088960, 2392: 308855040, 1944: 255091680, 1044: 39510180, 2070: 301507920, 2592: 604661760, 24: 480, 1540: 129692640, 1050: 41107500, 2076: 310663020, 30:... | 1,378.714286 | 9,533 | 0.745622 |
88bad06a304e0b32601988c6c12d380586f6c7a6 | 78,564 | py | Python | pika/spec.py | Anthchirp/pika | 55557c9172edb04256a5e49b7faf13078d5a0f66 | [
"BSD-3-Clause"
] | 2,479 | 2015-01-01T20:06:23.000Z | 2022-03-31T13:29:19.000Z | pika/spec.py | Anthchirp/pika | 55557c9172edb04256a5e49b7faf13078d5a0f66 | [
"BSD-3-Clause"
] | 813 | 2015-01-07T07:13:49.000Z | 2022-03-28T05:05:06.000Z | pika/spec.py | Anthchirp/pika | 55557c9172edb04256a5e49b7faf13078d5a0f66 | [
"BSD-3-Clause"
] | 763 | 2015-01-10T04:38:33.000Z | 2022-03-31T07:24:57.000Z | """
AMQP Specification
==================
This module implements the constants and classes that comprise AMQP protocol
level constructs. It should rarely be directly referenced outside of Pika's
own internal use.
.. note:: Auto-generated code by codegen.py, do not edit directly. Pull
requests to this file without acco... | 33.790968 | 255 | 0.57217 |
fd941f9d46aa8a6a9d851c3edb83c0145cb00a50 | 1,589 | py | Python | more/jinja2/tests/test_jinja2.py | sgaist/more.jinja2 | 8f6fb3034b7f15a4d8de9f0891b06bff6859f9df | [
"BSD-3-Clause"
] | 4 | 2015-05-16T19:48:34.000Z | 2019-06-23T20:19:31.000Z | more/jinja2/tests/test_jinja2.py | sgaist/more.jinja2 | 8f6fb3034b7f15a4d8de9f0891b06bff6859f9df | [
"BSD-3-Clause"
] | 10 | 2015-01-07T14:12:58.000Z | 2020-10-02T14:54:44.000Z | more/jinja2/tests/test_jinja2.py | sgaist/more.jinja2 | 8f6fb3034b7f15a4d8de9f0891b06bff6859f9df | [
"BSD-3-Clause"
] | 5 | 2015-05-15T22:15:39.000Z | 2020-10-02T13:51:20.000Z | from webtest import TestApp as Client
from .fixtures import (
template,
template_inheritance,
override_template,
override_template_inheritance,
)
def test_template():
c = Client(template.App())
response = c.get("/persons/world")
assert (
response.body
== b"""\
<html>
<body... | 14.990566 | 54 | 0.572058 |
f1db51c82ce93f4168729180ad3c48604c36fff2 | 820 | py | Python | login/forms.py | hpathipati/Quick-Tutor | 17476d79b87f51b12a6c8fc435d1a6506bff1e04 | [
"PostgreSQL",
"Unlicense",
"MIT"
] | null | null | null | login/forms.py | hpathipati/Quick-Tutor | 17476d79b87f51b12a6c8fc435d1a6506bff1e04 | [
"PostgreSQL",
"Unlicense",
"MIT"
] | null | null | null | login/forms.py | hpathipati/Quick-Tutor | 17476d79b87f51b12a6c8fc435d1a6506bff1e04 | [
"PostgreSQL",
"Unlicense",
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
class CustomUserCreationForm(UserCreationForm):
first_name = forms.CharField(max_length=20, required=True)
last_name = forms.CharField(max_length=20, required=True)
email = forms.Ema... | 34.166667 | 69 | 0.676829 |
2bd7ec2799c77b8cfc2c39ff7d65a35aa592cfd2 | 2,229 | py | Python | lib/surface/compute/packet_mirrorings/delete.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/compute/packet_mirrorings/delete.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/packet_mirrorings/delete.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. 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... | 33.268657 | 78 | 0.762225 |
a82dbdde3f3223ce8093dd0dbe850283d773946d | 1,838 | py | Python | core-python-basic-knowledge/built-in-collections/dictionaries.py | hassonor/core-python | 92672aa72c1474061df5247a2dd4dfd9fab1642a | [
"MIT"
] | 1 | 2022-03-09T20:58:33.000Z | 2022-03-09T20:58:33.000Z | core-python-basic-knowledge/built-in-collections/dictionaries.py | hassonor/core-python | 92672aa72c1474061df5247a2dd4dfd9fab1642a | [
"MIT"
] | null | null | null | core-python-basic-knowledge/built-in-collections/dictionaries.py | hassonor/core-python | 92672aa72c1474061df5247a2dd4dfd9fab1642a | [
"MIT"
] | null | null | null | # Dictionaries
"""
Dictionary internals
Keys -> Must be immutable
Values -> May be mutable
As with lists, dictionary copying is shallow (by default)
"""
names_and_ages = [('Alice', 32), ('Bob', 48), ('Charlie', 50)]
d = dict(names_and_ages)
print(d)
phonetic = dict(a='alfa', b='bravo', c='charlie', d='delta', e='ec... | 20.651685 | 85 | 0.661045 |
793977499297aed0f218ba21656fe03f7f6eb554 | 4,114 | py | Python | scripts/fractal-tree.py | dogerish/dogerbot | f148d832ae10677cd7e1b822f8a7dc5676c05903 | [
"MIT"
] | 1 | 2020-12-07T04:05:33.000Z | 2020-12-07T04:05:33.000Z | scripts/fractal-tree.py | dogerish/dogerbot | f148d832ae10677cd7e1b822f8a7dc5676c05903 | [
"MIT"
] | null | null | null | scripts/fractal-tree.py | dogerish/dogerbot | f148d832ae10677cd7e1b822f8a7dc5676c05903 | [
"MIT"
] | null | null | null | #! /usr/bin/python3
speedtest = False
from math import sin, cos, pi
from random import randrange
if speedtest: from time import time
import pygame, sys
if speedtest: start = time()
noneargs = (None, "", ' ', "None", "N/A", "n/a", '/', '-')
default = lambda arg, d: arg if arg not in noneargs else d
arglist = "out, col... | 30.474074 | 121 | 0.623238 |
bee9f8c635784361f9852b7daae992dd6d892199 | 7,460 | py | Python | ros/src/tl_detector/tl_detector.py | yufeiliubrown/carnd_clothoid | 0e6c008ca7f4d91a845c35ca2d925bcb8e21ac94 | [
"MIT"
] | 1 | 2018-07-20T04:13:04.000Z | 2018-07-20T04:13:04.000Z | ros/src/tl_detector/tl_detector.py | yufeiliubrown/carnd_clothoid | 0e6c008ca7f4d91a845c35ca2d925bcb8e21ac94 | [
"MIT"
] | null | null | null | ros/src/tl_detector/tl_detector.py | yufeiliubrown/carnd_clothoid | 0e6c008ca7f4d91a845c35ca2d925bcb8e21ac94 | [
"MIT"
] | 5 | 2018-07-15T22:21:06.000Z | 2018-08-10T11:49:39.000Z | #!/usr/bin/env python
import rospy
from std_msgs.msg import Int32
from geometry_msgs.msg import PoseStamped, Pose
from styx_msgs.msg import TrafficLightArray, TrafficLight
from styx_msgs.msg import Lane
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
from light_classification.tl_classifier import TLCla... | 37.676768 | 132 | 0.635255 |
13404112a5df27176a197511b092089ff3b23817 | 7,652 | py | Python | src/filetypes/text_x_python.py | suhailvs/grailbrowser | 7e0ea8d501759626d4186b371933a2493bf7ef58 | [
"CNRI-Jython"
] | 8 | 2015-02-18T18:50:50.000Z | 2022-03-15T22:21:03.000Z | src/filetypes/text_x_python.py | suhailvs/grailbrowser | 7e0ea8d501759626d4186b371933a2493bf7ef58 | [
"CNRI-Jython"
] | null | null | null | src/filetypes/text_x_python.py | suhailvs/grailbrowser | 7e0ea8d501759626d4186b371933a2493bf7ef58 | [
"CNRI-Jython"
] | 3 | 2016-04-04T23:54:07.000Z | 2020-10-29T04:25:42.000Z | """<OBJECT> handler for Python applets."""
__version__ = '$Revision: 1.5 $'
import grailutil
import re
import string
import Tkinter
import token
import AppletLoader
import sgml.HTMLParser
whitespace = '\\t\\n\x0b\x0c\\r '
def embed_text_x_python(parser, attrs):
"""<OBJECT> Handler for Python applets."""
e... | 31.751037 | 73 | 0.660481 |
15810fb8e0a741229da911333397c1b706d02ac1 | 143 | py | Python | test/test_doctest.py | WRY-learning/k3awssign | f25b42886e06e668b037058d01ae43a13be7ee70 | [
"MIT"
] | null | null | null | test/test_doctest.py | WRY-learning/k3awssign | f25b42886e06e668b037058d01ae43a13be7ee70 | [
"MIT"
] | 2 | 2021-11-10T18:17:06.000Z | 2022-03-23T06:48:42.000Z | test/test_doctest.py | WRY-learning/k3awssign | f25b42886e06e668b037058d01ae43a13be7ee70 | [
"MIT"
] | 2 | 2021-08-09T04:16:30.000Z | 2021-08-23T09:45:31.000Z | import doctest
import k3awssign
def load_tests(loader, tests, ignore):
tests.addTests(doctest.DocTestSuite(k3awssign))
return tests
| 15.888889 | 51 | 0.769231 |
7260a5ecf9d435d6b3e370c8ef439589d34eb8a9 | 1,079 | py | Python | main.py | bluecough/AMP_AD_Hostname_check | ba76543ffa4cef87d2e834cab0bcbfc460298d5a | [
"BSD-Source-Code"
] | null | null | null | main.py | bluecough/AMP_AD_Hostname_check | ba76543ffa4cef87d2e834cab0bcbfc460298d5a | [
"BSD-Source-Code"
] | null | null | null | main.py | bluecough/AMP_AD_Hostname_check | ba76543ffa4cef87d2e834cab0bcbfc460298d5a | [
"BSD-Source-Code"
] | null | null | null | ## AMP AD Hostname Check
## Check AD and then call AMP to see if the hostname is also in AMP
## Authors: George Seeto, Chantel Strickland, Dave Schwartberg
##
import sys, requests, json, urllib3
def main():
# Get the input args
client_id = sys.argv[1]
api_key = sys.argv[2]
csvfilename = sys.argv[3]
... | 26.975 | 108 | 0.622799 |
a919a2bbb25a1cb933180444bb55d93ce116cef9 | 7,581 | py | Python | test/sources/test_merge.py | ChowNow/blingalytics | a05c866bc0dc7c56b5106c71c12cf10b37c5bae5 | [
"MIT"
] | null | null | null | test/sources/test_merge.py | ChowNow/blingalytics | a05c866bc0dc7c56b5106c71c12cf10b37c5bae5 | [
"MIT"
] | 1 | 2019-08-16T07:15:42.000Z | 2019-08-16T15:27:18.000Z | test/sources/test_merge.py | ChowNow/blingalytics | a05c866bc0dc7c56b5106c71c12cf10b37c5bae5 | [
"MIT"
] | 1 | 2017-06-01T23:32:08.000Z | 2017-06-01T23:32:08.000Z | from __future__ import absolute_import
from decimal import Decimal
import unittest
from blingalytics import widgets
from blingalytics.sources import merge
from mock import Mock
from test import entities, reports
class TestMergeSource(unittest.TestCase):
def setUp(self):
cache = Mock()
cache.inst... | 70.850467 | 169 | 0.612848 |
a09af369db74fada3f95f3737fdb9622679bab47 | 994 | py | Python | example/archive.py | brucebentley/SlackCleaner | 43ef0d32090452394b1eb7591611f95332957f91 | [
"MIT"
] | 1 | 2021-05-13T00:37:22.000Z | 2021-05-13T00:37:22.000Z | example/archive.py | brucebentley/slack_cleaner2 | 43ef0d32090452394b1eb7591611f95332957f91 | [
"MIT"
] | null | null | null | example/archive.py | brucebentley/slack_cleaner2 | 43ef0d32090452394b1eb7591611f95332957f91 | [
"MIT"
] | null | null | null | import os
from SlackCleaner import SlackCleaner, a_while_ago, is_not_pinned
from pymongo import MongoClient
from pymongo.errors import DuplicateKeyError
client = MongoClient()
s = SlackCleaner(os.environ['TOKEN'], 1)
db = client.slack_cleaner
f = is_not_pinned()
before = a_while_ago(months=2)
def archive(c):
arch... | 22.088889 | 73 | 0.68008 |
e96a4c0de8d58c49ee4ef2637ae1916072943339 | 32,139 | py | Python | pymc3/tests/test_step.py | nokados/pymc3 | abed82345e2932b3a77fcc67894f7eb6bae8797c | [
"Apache-2.0"
] | null | null | null | pymc3/tests/test_step.py | nokados/pymc3 | abed82345e2932b3a77fcc67894f7eb6bae8797c | [
"Apache-2.0"
] | null | null | null | pymc3/tests/test_step.py | nokados/pymc3 | abed82345e2932b3a77fcc67894f7eb6bae8797c | [
"Apache-2.0"
] | null | null | null | import shutil
import tempfile
import sys
from .checks import close_to
from .models import (
simple_categorical,
mv_simple,
mv_simple_discrete,
mv_prior_simple,
simple_2model_continuous,
)
from pymc3.sampling import assign_step_methods, sample
from pymc3.parallel_sampling import ParallelSamplingErro... | 31.447162 | 100 | 0.438937 |
6a79d11c9fb366d951ce21a21e9a831ad862579d | 17,524 | py | Python | nvflare/private/fed/client/client_executor.py | Can-Zhao/NVFlare | 52d9dee9972b32d49d9a8add52a652ce3bb878b5 | [
"Apache-2.0"
] | 155 | 2021-08-05T18:05:09.000Z | 2022-03-27T15:32:56.000Z | nvflare/private/fed/client/client_executor.py | Can-Zhao/NVFlare | 52d9dee9972b32d49d9a8add52a652ce3bb878b5 | [
"Apache-2.0"
] | 216 | 2021-12-01T06:07:12.000Z | 2022-03-30T23:34:02.000Z | nvflare/private/fed/client/client_executor.py | Can-Zhao/NVFlare | 52d9dee9972b32d49d9a8add52a652ce3bb878b5 | [
"Apache-2.0"
] | 44 | 2021-11-24T16:03:29.000Z | 2022-03-24T23:28:39.000Z | # Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ... | 36.970464 | 119 | 0.594214 |
11fd80f587d5b158869efd47a0af863271c09bff | 236 | py | Python | code/matplotlib/test.py | qiudebo/13learn | 32b6ab0c6f6abd5873e3445b31a86f602520d473 | [
"MIT"
] | 1 | 2019-03-07T09:02:27.000Z | 2019-03-07T09:02:27.000Z | code/matplotlib/test.py | qiudebo/13learn | 32b6ab0c6f6abd5873e3445b31a86f602520d473 | [
"MIT"
] | null | null | null | code/matplotlib/test.py | qiudebo/13learn | 32b6ab0c6f6abd5873e3445b31a86f602520d473 | [
"MIT"
] | null | null | null | # *-* coding:utf-8 *-*
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from matplotlib import style
import os
from os import path
from matplotlib.font_manager import fontManager
# 图表坐标系
| 11.8 | 48 | 0.699153 |
3588bb38100b775456e66128b76bd04ad107b891 | 52,545 | py | Python | spytest/apis/system/pfc.py | emilmih/sonic-mgmt | e4e42ec8028bf51b39587e2b53e526d505fe7938 | [
"Apache-2.0"
] | 132 | 2016-10-19T12:34:44.000Z | 2022-03-16T09:00:39.000Z | spytest/apis/system/pfc.py | emilmih/sonic-mgmt | e4e42ec8028bf51b39587e2b53e526d505fe7938 | [
"Apache-2.0"
] | 3,152 | 2016-09-21T23:05:58.000Z | 2022-03-31T23:29:08.000Z | spytest/apis/system/pfc.py | emilmih/sonic-mgmt | e4e42ec8028bf51b39587e2b53e526d505fe7938 | [
"Apache-2.0"
] | 563 | 2016-09-20T01:00:15.000Z | 2022-03-31T22:43:54.000Z | import json
from spytest import st
from apis.system.interface import interface_status_show, clear_interface_counters
from spytest.utils import filter_and_select
from utilities.common import make_list
from utilities.utils import get_interface_number_from_name
from apis.system.rest import config_rest, delete_rest, get_r... | 55.020942 | 300 | 0.602931 |
21819fb02e3d976ea32d00521909365d93e5b2b0 | 2,622 | py | Python | Problem4.py | taking1fortheteam/pands-problem-set | 576c1049a19bb642e56e08733200cb57d3274a50 | [
"Apache-2.0"
] | null | null | null | Problem4.py | taking1fortheteam/pands-problem-set | 576c1049a19bb642e56e08733200cb57d3274a50 | [
"Apache-2.0"
] | null | null | null | Problem4.py | taking1fortheteam/pands-problem-set | 576c1049a19bb642e56e08733200cb57d3274a50 | [
"Apache-2.0"
] | null | null | null | # Aidan Conlon - 22 March 2019
# This is the solution to Problem 4
# Write a program that asks the user to input any positive integer and outputs the
# successive values of the following calculation. At each step calculate the next value
# by taking the current value and, if it is even, divide it by two, but if it is o... | 87.4 | 200 | 0.494279 |
df98aae12eb9e2c90499328065dc3c12c78d49fb | 20,942 | py | Python | test/functional/feature_pruning.py | satcoin-dev/satcoin | a68f5965a8c28cfcaf8855a661ea3f15de9ae7d5 | [
"MIT"
] | 4 | 2021-02-28T04:34:58.000Z | 2021-09-14T15:25:31.000Z | test/functional/feature_pruning.py | satcoin-dev/satcoin | a68f5965a8c28cfcaf8855a661ea3f15de9ae7d5 | [
"MIT"
] | null | null | null | test/functional/feature_pruning.py | satcoin-dev/satcoin | a68f5965a8c28cfcaf8855a661ea3f15de9ae7d5 | [
"MIT"
] | 1 | 2021-06-18T13:13:17.000Z | 2021-06-18T13:13:17.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the pruning code.
WARNING:
This test uses 4GB of disk space.
This test takes 30 mins or more (up ... | 45.133621 | 140 | 0.612692 |
64efb85c349bc2ebd6567c17f7b64401e5228d72 | 24,505 | py | Python | src/extractor.py | Fireronin/TLoB | 86a2c6d119a0746ece7a9afd179777edc67c4f96 | [
"MIT"
] | null | null | null | src/extractor.py | Fireronin/TLoB | 86a2c6d119a0746ece7a9afd179777edc67c4f96 | [
"MIT"
] | null | null | null | src/extractor.py | Fireronin/TLoB | 86a2c6d119a0746ece7a9afd179777edc67c4f96 | [
"MIT"
] | null | null | null | from copy import deepcopy
from dataclasses import dataclass
import enum
from typing import Dict, List, Tuple, Union
from lark import Lark, Transformer, v_args
import os
from sympy import EX, arg
with open(os.path.join(os.path.join(os.path.dirname(__file__),"..","grammar","tests"), "testFunc.json")) as f:
exampl... | 29.775213 | 147 | 0.583636 |
362673a71b7589832958f5131bc6272eb5d6f210 | 17,662 | py | Python | tests/test_middleware.py | st3ldz/django-cors-headers | 57a5bdfef2223a2f6f973bcbae261c3055136707 | [
"MIT"
] | null | null | null | tests/test_middleware.py | st3ldz/django-cors-headers | 57a5bdfef2223a2f6f973bcbae261c3055136707 | [
"MIT"
] | null | null | null | tests/test_middleware.py | st3ldz/django-cors-headers | 57a5bdfef2223a2f6f973bcbae261c3055136707 | [
"MIT"
] | null | null | null | from django.http import HttpResponse
from django.test import TestCase
from django.test.utils import override_settings
from django.utils.deprecation import MiddlewareMixin
from corsheaders.middleware import (
ACCESS_CONTROL_ALLOW_CREDENTIALS,
ACCESS_CONTROL_ALLOW_HEADERS,
ACCESS_CONTROL_ALLOW_METHODS,
A... | 41.074419 | 126 | 0.664591 |
42aa73aa8145fe4c64603fbc7c7c3ce80aca0a50 | 348 | py | Python | FiNDAPI/api/classification/operations.py | NanoNLP/FiNDAPI | 421745530c808a2253081672cc2ee64271a68cf0 | [
"MIT"
] | null | null | null | FiNDAPI/api/classification/operations.py | NanoNLP/FiNDAPI | 421745530c808a2253081672cc2ee64271a68cf0 | [
"MIT"
] | null | null | null | FiNDAPI/api/classification/operations.py | NanoNLP/FiNDAPI | 421745530c808a2253081672cc2ee64271a68cf0 | [
"MIT"
] | null | null | null | def create_classification(data):
"""
Adds a classification to a paper in the database.
"""
# TODO
def update_classification(id, data):
"""
Updates the classifications related to a paper.
"""
# TODO
def delete_classification(id, data):
"""
Deletes all classifications related to... | 19.333333 | 53 | 0.632184 |
4521a15b119998303645a67e6434d256285e019f | 677 | py | Python | app/core/management/commands/wait_for_db.py | drewjg11/recipe-app-api | 6bf5dc8e5876fe181d63455f3fcc14e482e98a04 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | drewjg11/recipe-app-api | 6bf5dc8e5876fe181d63455f3fcc14e482e98a04 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | drewjg11/recipe-app-api | 6bf5dc8e5876fe181d63455f3fcc14e482e98a04 | [
"MIT"
] | null | null | null | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Django command to pause execution until database is available"""
def handle(self, *args, **options):
self.stdout.write('Waitin... | 30.772727 | 78 | 0.646972 |
7f85cc861b08f8365c7fb7c2f03cdbbaf9da4978 | 395 | py | Python | buyandbye/wsgi.py | The-God-Fathers/BuyandBye | c473a09ff3764ae28c3f5608ab83117c7a806c01 | [
"MIT"
] | null | null | null | buyandbye/wsgi.py | The-God-Fathers/BuyandBye | c473a09ff3764ae28c3f5608ab83117c7a806c01 | [
"MIT"
] | 8 | 2021-03-19T10:14:56.000Z | 2022-03-12T00:43:14.000Z | buyandbye/wsgi.py | The-God-Fathers/BuyandBye | c473a09ff3764ae28c3f5608ab83117c7a806c01 | [
"MIT"
] | null | null | null | """
WSGI config for buyandbye project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
87049d43a7788fa56c8ae642c4a4c4910d29121b | 1,437 | py | Python | setup.py | nurupo/mingw-ldd | 67eff2bf8a48b070539f7a6a1855dac0a3174189 | [
"MIT"
] | 11 | 2020-05-31T12:55:48.000Z | 2022-03-03T08:37:39.000Z | setup.py | nurupo/mingw-ldd | 67eff2bf8a48b070539f7a6a1855dac0a3174189 | [
"MIT"
] | 1 | 2021-11-26T18:40:25.000Z | 2021-12-29T03:13:15.000Z | setup.py | nurupo/mingw-ldd | 67eff2bf8a48b070539f7a6a1855dac0a3174189 | [
"MIT"
] | 1 | 2020-05-31T05:05:32.000Z | 2020-05-31T05:05:32.000Z | import os
from setuptools import setup
about = {}
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'mingw_ldd', '__version__.py'), 'r', encoding='utf-8') as f:
exec(f.read(), about)
setup(
name=about['__title__'],
version=about['__version__'],
description=about['__descri... | 34.214286 | 116 | 0.627001 |
72b3bb0c3f698f10a044d9116145b039809ae3a1 | 1,899 | py | Python | commands/restrictions.py | nstra111/autovc | e73e1fea7b566721c3dce3ca6f587472e7ee9d1b | [
"MIT"
] | 177 | 2020-02-02T18:03:46.000Z | 2022-03-17T06:18:43.000Z | commands/restrictions.py | zigsphere/Auto-Voice-Channels | 6ae901728580bef4246737a6f1b9f10763badd3e | [
"MIT"
] | 82 | 2020-02-02T17:43:18.000Z | 2022-03-24T20:34:55.000Z | commands/restrictions.py | zigsphere/Auto-Voice-Channels | 6ae901728580bef4246737a6f1b9f10763badd3e | [
"MIT"
] | 165 | 2019-02-17T20:15:20.000Z | 2022-03-27T23:59:23.000Z | from commands.base import Cmd
help_text = [
[
("Usage:",
"<PREFIX><COMMAND>\n"
"<PREFIX><COMMAND> `COMMAND`"),
("Description:",
"Show any role retrictions set for all or a particular command using `<PREFIX>restrict`."),
("Examples:",
"`<PREFIX><COMMAND>`\... | 30.629032 | 100 | 0.558715 |
72678a16069d8c129e6ba9e703f65e4e95eb4c4e | 2,407 | py | Python | energyPATHWAYS/tests/test_util.py | jdailey/EnergyPATHWAYS | 0fb0ead475b6395f6b07fc43fe6c85826ee47d0f | [
"MIT"
] | 26 | 2017-02-06T22:57:29.000Z | 2022-03-25T20:02:32.000Z | energyPATHWAYS/tests/test_util.py | jdailey/EnergyPATHWAYS | 0fb0ead475b6395f6b07fc43fe6c85826ee47d0f | [
"MIT"
] | 65 | 2016-01-22T01:33:05.000Z | 2016-09-03T14:46:08.000Z | energyPATHWAYS/tests/test_util.py | jdailey/EnergyPATHWAYS | 0fb0ead475b6395f6b07fc43fe6c85826ee47d0f | [
"MIT"
] | 11 | 2017-02-24T23:27:36.000Z | 2021-10-18T17:33:37.000Z | # -*- coding: utf-8 -*-
__author__ = 'Michael'
import unittest
import mock
import energyPATHWAYS
from energyPATHWAYS.util import *
def read_table(table_name, column_names='*', return_unique=False, return_iterable=False, **filters):
if table_name == 'IDMap' and column_names == 'identifier_id, ref_table':
... | 42.982143 | 118 | 0.68924 |
9c4657a8e97af86c06b64e77bc178212bb2d5c77 | 1,798 | py | Python | Tree/lca_of_binary_tree.py | lakshyarawal/pythonPractice | 4b400342198a8270c5ac0c6306afb555f927c6c1 | [
"MIT"
] | null | null | null | Tree/lca_of_binary_tree.py | lakshyarawal/pythonPractice | 4b400342198a8270c5ac0c6306afb555f927c6c1 | [
"MIT"
] | null | null | null | Tree/lca_of_binary_tree.py | lakshyarawal/pythonPractice | 4b400342198a8270c5ac0c6306afb555f927c6c1 | [
"MIT"
] | null | null | null | """ LCA: Lowest Common Ancestor of two values in a binary tree """
from binary_tree_traversal_and_height import Node
from collections import deque
def find_path(root_n, path_a, n):
if root_n is None:
return False
path_a.append(root_n.value)
if root_n.value == n:
return True
if find_pat... | 26.441176 | 91 | 0.644605 |
b9980b32a1241f7718ed2032c03470ff8505b849 | 8,092 | py | Python | ks_gini_cap30_AUC_multilabel.py | gaho8435/ks_gini_cap30_AUC | e04f3813869cb2183c4772190918e69a4f94492c | [
"MIT"
] | null | null | null | ks_gini_cap30_AUC_multilabel.py | gaho8435/ks_gini_cap30_AUC | e04f3813869cb2183c4772190918e69a4f94492c | [
"MIT"
] | null | null | null | ks_gini_cap30_AUC_multilabel.py | gaho8435/ks_gini_cap30_AUC | e04f3813869cb2183c4772190918e69a4f94492c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import time
import copy
from keras.utils import to_categorical
from sklearn import ensemble, preprocessing, metrics, model_selection
from sklearn.metrics import roc_auc_score
# In[2]:
import pand... | 41.927461 | 181 | 0.522491 |
ac4d6219dfd4c78ef33be7127dede2b7ca38bddd | 3,159 | py | Python | app/recipe/tests/test_recipe_api.py | fdelacruz/recipe-app-api | 3e8974f571895ede0515a77435b96de8b4f0b0d1 | [
"MIT"
] | null | null | null | app/recipe/tests/test_recipe_api.py | fdelacruz/recipe-app-api | 3e8974f571895ede0515a77435b96de8b4f0b0d1 | [
"MIT"
] | null | null | null | app/recipe/tests/test_recipe_api.py | fdelacruz/recipe-app-api | 3e8974f571895ede0515a77435b96de8b4f0b0d1 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from recipe.serializers import RecipeSerializer, RecipeDetailSerializer
RECIPES... | 28.718182 | 71 | 0.674897 |
7e911e15153f49dd8ca95a5b2fd5247a819d03f7 | 3,383 | py | Python | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.647887 | 172 | 0.691398 |
371089936ef59971826dc076482d6683f8f08569 | 2,405 | py | Python | saleor/discount/migrations/0010_auto_20180724_1251.py | acabezasg/urpi-master | 7c9cd0fbe6d89dad70652482712ca38b21ba6f84 | [
"BSD-3-Clause"
] | 6 | 2019-01-06T08:39:20.000Z | 2022-03-04T18:07:47.000Z | saleor/discount/migrations/0010_auto_20180724_1251.py | acabezasg/urpi-master | 7c9cd0fbe6d89dad70652482712ca38b21ba6f84 | [
"BSD-3-Clause"
] | 64 | 2019-02-11T17:02:05.000Z | 2021-06-25T15:16:57.000Z | saleor/discount/migrations/0010_auto_20180724_1251.py | acabezasg/urpi-master | 7c9cd0fbe6d89dad70652482712ca38b21ba6f84 | [
"BSD-3-Clause"
] | 2 | 2019-01-08T02:32:42.000Z | 2021-07-05T14:05:55.000Z | # Generated by Django 2.0.3 on 2018-07-24 17:51
import datetime
from django.db import migrations, models
import django_countries.fields
class Migration(migrations.Migration):
dependencies = [
('product', '0065_auto_20180719_0520'),
('discount', '0009_auto_20180719_0520'),
]
operations =... | 32.5 | 265 | 0.567568 |
8edef83b90fe064eda0287db5647da839efc3cc5 | 2,992 | py | Python | zstackwoodpecker/zstackwoodpecker/operations/primarystorage_operations.py | hyhhui/zstack-woodpecker | ac36ae033cc521e2f877763de3ff55e4762e3ae0 | [
"Apache-2.0"
] | null | null | null | zstackwoodpecker/zstackwoodpecker/operations/primarystorage_operations.py | hyhhui/zstack-woodpecker | ac36ae033cc521e2f877763de3ff55e4762e3ae0 | [
"Apache-2.0"
] | null | null | null | zstackwoodpecker/zstackwoodpecker/operations/primarystorage_operations.py | hyhhui/zstack-woodpecker | ac36ae033cc521e2f877763de3ff55e4762e3ae0 | [
"Apache-2.0"
] | 2 | 2020-03-12T03:11:28.000Z | 2021-07-26T01:57:58.000Z | '''
All primary_storage operations for test.
@author: Youyk
'''
import apibinding.api_actions as api_actions
import zstackwoodpecker.test_util as test_util
import account_operations
import apibinding.inventory as inventory
def create_nfs_primary_storage(primary_storage_option, session_uuid=None):
a... | 42.742857 | 92 | 0.745321 |
f8f998223de5894e4c51e0d34cb69b88a879ff4b | 228 | py | Python | MoogTools/generateSpectrum.py | soylentdeen/MoogPy | 9485a7e302ef4d4339013f27672d1d5e7059a41f | [
"MIT"
] | 5 | 2015-08-21T17:18:15.000Z | 2021-09-03T15:55:35.000Z | MoogTools/generateSpectrum.py | soylentdeen/MoogPy | 9485a7e302ef4d4339013f27672d1d5e7059a41f | [
"MIT"
] | null | null | null | MoogTools/generateSpectrum.py | soylentdeen/MoogPy | 9485a7e302ef4d4339013f27672d1d5e7059a41f | [
"MIT"
] | 4 | 2016-03-28T09:39:44.000Z | 2019-07-20T07:47:39.000Z | #!/usr/bin/python
import MoogTools
import sys
moogPyConfigFile = sys.argv[1]
flavor = sys.argv[2]
Moog = MoogTools.MoogStokes(moogPyConfigFile, fileBase=flavor, moogInstance='Alpha', progressBar = True)
Moog.run(saveRaw=True)
| 25.333333 | 105 | 0.776316 |
9e137dde54ae747725bd6fd27343f60e8c3bf4fd | 435 | py | Python | Chapter9/lesson60/pybotweb.py | beproud/yasashiipython2e | 00afb264ec8428b0149ac12854c8e11c30bee338 | [
"MIT"
] | null | null | null | Chapter9/lesson60/pybotweb.py | beproud/yasashiipython2e | 00afb264ec8428b0149ac12854c8e11c30bee338 | [
"MIT"
] | 2 | 2020-08-03T02:31:35.000Z | 2020-08-03T03:02:25.000Z | Chapter9/lesson60/pybotweb.py | beproud/yasashiipython2e | 00afb264ec8428b0149ac12854c8e11c30bee338 | [
"MIT"
] | null | null | null | from bottle import route, run, template, request
from pybot import pybot
@route('/hello')
def hello():
return template('pybot_template', input_text='', output_text='')
@route('/hello', method='POST')
def do_hello():
input_text = request.forms.input_text
output_text = pybot(input_text)
return templat... | 24.166667 | 85 | 0.731034 |
e9044a0e04debc89ba9d53f3668e45a4b059c57d | 1,461 | py | Python | bin/narrowpeak2summitFlankingBed.py | odingsy/NGStoolkit | 68d73810351550b9ba75f9184f26bc8e55708fcc | [
"MIT"
] | 2 | 2018-05-05T06:24:51.000Z | 2021-07-04T22:24:13.000Z | bin/narrowpeak2summitFlankingBed.py | odingsy/NGStoolkit | 68d73810351550b9ba75f9184f26bc8e55708fcc | [
"MIT"
] | null | null | null | bin/narrowpeak2summitFlankingBed.py | odingsy/NGStoolkit | 68d73810351550b9ba75f9184f26bc8e55708fcc | [
"MIT"
] | 2 | 2020-12-27T22:02:29.000Z | 2021-05-28T20:28:26.000Z | #!/usr/bin/env python
import sys
import os
import argparse
import bed
import generalUtils
parser = argparse.ArgumentParser(description='takes bed as input, get the middle point and extend it to both sides')
parser.add_argument('-i', nargs='?', type=argparse.FileType('r'), default=sys.stdin, help='input')
parser.add_ar... | 36.525 | 151 | 0.698152 |
3690099749126536bfe5ba28cd63acdfdca500a2 | 1,466 | py | Python | tools/generate_taint_models/get_REST_api_sources.py | s-pace/pyre-check | 2b71dcf22e4672567cfe0dfef356f11646d66244 | [
"MIT"
] | 5 | 2019-02-14T19:46:47.000Z | 2020-01-16T05:48:45.000Z | tools/generate_taint_models/get_REST_api_sources.py | s-pace/pyre-check | 2b71dcf22e4672567cfe0dfef356f11646d66244 | [
"MIT"
] | null | null | null | tools/generate_taint_models/get_REST_api_sources.py | s-pace/pyre-check | 2b71dcf22e4672567cfe0dfef356f11646d66244 | [
"MIT"
] | 2 | 2019-02-14T19:46:23.000Z | 2020-07-13T03:53:04.000Z | # Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
from typing import Callable, Iterable, List, Optional
from .function_tainter import taint_functions
from .model import CallableMode... | 34.904762 | 75 | 0.71487 |
d79795c5170cf6305c9f5a93281d34495c05ebf6 | 3,132 | py | Python | sdc/tests/test_series_map.py | dlee992/sdc | 1ebf55c00ef38dfbd401a70b3945e352a5a38b87 | [
"BSD-2-Clause"
] | 540 | 2017-06-19T16:29:24.000Z | 2019-05-21T09:30:07.000Z | sdc/tests/test_series_map.py | dlee992/sdc | 1ebf55c00ef38dfbd401a70b3945e352a5a38b87 | [
"BSD-2-Clause"
] | 389 | 2019-10-30T18:56:46.000Z | 2022-03-09T08:21:36.000Z | sdc/tests/test_series_map.py | dlee992/sdc | 1ebf55c00ef38dfbd401a70b3945e352a5a38b87 | [
"BSD-2-Clause"
] | 36 | 2017-06-19T16:29:15.000Z | 2019-04-26T09:22:39.000Z | # *****************************************************************************
# Copyright (c) 2020, Intel Corporation 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 sou... | 36.847059 | 79 | 0.644955 |
13e411d8904f76c2270201df68c2306cb5da3e85 | 1,443 | py | Python | excluir.py | hilbertspace05/Tkinter-CRUD | b1b3a3b7557b0e5cb203e2b5e2ae4d3a29e9a5cb | [
"MIT"
] | null | null | null | excluir.py | hilbertspace05/Tkinter-CRUD | b1b3a3b7557b0e5cb203e2b5e2ae4d3a29e9a5cb | [
"MIT"
] | null | null | null | excluir.py | hilbertspace05/Tkinter-CRUD | b1b3a3b7557b0e5cb203e2b5e2ae4d3a29e9a5cb | [
"MIT"
] | null | null | null | import tkinter as tk
import mysql.connector
from mysql.connector import Error
import paginainicial
LARGE_FONT = ("Verdana", 12)
try:
cnx = mysql.connector.connect(user='root', password='',
host='127.0.0.1',
database='crud')
except Error as erro:
... | 30.702128 | 95 | 0.557173 |
eb691f8835f16a98a745e79f5ef9c8edef06951d | 1,787 | py | Python | internal/notes/builtin-SAVE/packages/libxres/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 1 | 2019-01-17T20:07:19.000Z | 2019-01-17T20:07:19.000Z | internal/notes/builtin-SAVE/packages/libxres/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | null | null | null | internal/notes/builtin-SAVE/packages/libxres/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 2 | 2019-08-06T18:13:57.000Z | 2021-11-05T18:19:49.000Z | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 41.55814 | 78 | 0.672636 |
cc6b0211b8d3c2ab70408809e8859fadeb186571 | 1,271 | py | Python | MCTSnet/models/backup.py | haixuanTao/MCTSnet | bac52fcba522291e07239bc998ff0441c8258752 | [
"MIT"
] | 15 | 2020-02-04T21:41:25.000Z | 2022-03-28T16:30:48.000Z | MCTSnet/models/backup.py | haixuanTao/MCTSnet | bac52fcba522291e07239bc998ff0441c8258752 | [
"MIT"
] | 9 | 2019-04-22T08:53:07.000Z | 2022-03-11T23:41:52.000Z | MCTSnet/models/backup.py | haixuanTao/MCTSnet | bac52fcba522291e07239bc998ff0441c8258752 | [
"MIT"
] | 4 | 2019-09-18T12:08:28.000Z | 2020-08-31T19:51:19.000Z | import torch
import torch.nn.functional as F
import torch.nn as nn
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
class BetaMLP(nn.Module):
def __init__(self, embeddings_size=128):
super().__init__()
self.fc1 = nn.Linear(embeddings_size * 2 + 2, embeddings_size).to(devic... | 29.55814 | 81 | 0.623918 |
315749810f3e6b11b8ea9db48524de4f0bb862e5 | 4,064 | py | Python | test/test_converters_and_test_searchspaces/test_sample_configuration_spaces.py | Yatoom/ConfigSpace | 45d577c11b2914ffdcb3270d83b42b8a85932147 | [
"BSD-3-Clause"
] | 148 | 2016-04-06T05:01:14.000Z | 2022-03-22T12:38:43.000Z | test/test_converters_and_test_searchspaces/test_sample_configuration_spaces.py | Yatoom/ConfigSpace | 45d577c11b2914ffdcb3270d83b42b8a85932147 | [
"BSD-3-Clause"
] | 222 | 2016-06-29T09:42:42.000Z | 2022-03-29T23:30:35.000Z | test/test_converters_and_test_searchspaces/test_sample_configuration_spaces.py | Yatoom/ConfigSpace | 45d577c11b2914ffdcb3270d83b42b8a85932147 | [
"BSD-3-Clause"
] | 80 | 2016-04-20T02:47:39.000Z | 2022-02-24T13:02:14.000Z | # Copyright (c) 2014-2016, ConfigSpace developers
# Matthias Feurer
# Katharina Eggensperger
# and others (see commit history).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributi... | 41.050505 | 81 | 0.688976 |
adcd57d8e14636885856d1325af237654ecb5ac1 | 22,989 | py | Python | sysinv/sysinv/sysinv/sysinv/openstack/common/rpc/impl_qpid.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | null | null | null | sysinv/sysinv/sysinv/sysinv/openstack/common/rpc/impl_qpid.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | null | null | null | sysinv/sysinv/sysinv/sysinv/openstack/common/rpc/impl_qpid.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | 1 | 2021-01-05T16:24:58.000Z | 2021-01-05T16:24:58.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# Copyright 2011 - 2012, Red Hat, 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
#
# ... | 35.313364 | 79 | 0.583235 |
e47d723179f80b97a4f84a891b34044c8970f7ed | 2,963 | py | Python | run_part_selector.py | SongweiGe/DoodlerGAN | d435d9b3c0579937cd3c22aa2051960ceb921785 | [
"MIT"
] | 92 | 2020-10-02T23:44:29.000Z | 2022-03-22T22:49:35.000Z | run_part_selector.py | SongweiGe/DoodlerGAN | d435d9b3c0579937cd3c22aa2051960ceb921785 | [
"MIT"
] | 4 | 2020-10-03T05:11:24.000Z | 2021-06-23T23:27:05.000Z | run_part_selector.py | SongweiGe/DoodlerGAN | d435d9b3c0579937cd3c22aa2051960ceb921785 | [
"MIT"
] | 11 | 2020-10-03T05:06:26.000Z | 2021-11-06T14:03:24.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
from retry.api import retry_call
from tqdm import tqdm
from part_selector import Trainer, NanException
from datetime import dat... | 36.580247 | 120 | 0.676679 |
07810d92eed545f822f378b77921b1e6519aac3b | 5,648 | py | Python | test/arwyerContigFilter_server_test.py | arwyer/arwyerContigFilter | f41ba06f6f8ee639e9bdf4d0848ae0d15e40eb13 | [
"MIT"
] | null | null | null | test/arwyerContigFilter_server_test.py | arwyer/arwyerContigFilter | f41ba06f6f8ee639e9bdf4d0848ae0d15e40eb13 | [
"MIT"
] | null | null | null | test/arwyerContigFilter_server_test.py | arwyer/arwyerContigFilter | f41ba06f6f8ee639e9bdf4d0848ae0d15e40eb13 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
import os # noqa: F401
import json # noqa: F401
import time
import requests
from os import environ
try:
from ConfigParser import ConfigParser # py2
except:
from configparser import ConfigParser # py3
from pprint import pprint # noqa: F401
from biokbase.workspace.c... | 42.466165 | 104 | 0.565864 |
c3bca896ee4afef94311e02269ecc4249a133cab | 4,270 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/5-2Nested_false-termination_10.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/5-2Nested_false-termination_10.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/5-2Nested_false-termination_10.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 28.657718 | 77 | 0.568618 |
50bdda1c624e32b3a3f1d145117b31678b3cf140 | 389 | py | Python | Web Scraping (Beautiful Soup, Scrapy, Selenium)/Web Scraping_ Day68/web scraping python wikipedia/Solution/crawler.py | pooja-gera/TheWireUsChallenge | 18abb5ff3fd31b7dbfef41b8008f91d3fac029d3 | [
"MIT"
] | null | null | null | Web Scraping (Beautiful Soup, Scrapy, Selenium)/Web Scraping_ Day68/web scraping python wikipedia/Solution/crawler.py | pooja-gera/TheWireUsChallenge | 18abb5ff3fd31b7dbfef41b8008f91d3fac029d3 | [
"MIT"
] | null | null | null | Web Scraping (Beautiful Soup, Scrapy, Selenium)/Web Scraping_ Day68/web scraping python wikipedia/Solution/crawler.py | pooja-gera/TheWireUsChallenge | 18abb5ff3fd31b7dbfef41b8008f91d3fac029d3 | [
"MIT"
] | 1 | 2021-05-21T09:30:41.000Z | 2021-05-21T09:30:41.000Z | import bs4
import requests
response = requests.get("https://en.wikipedia.org/wiki/Python_(programming_language)")
if response is not None:
page = bs4.BeautifulSoup(response.text, 'html.parser')
title = page.select("#firstHeading")[0].text
paragraphs = page.select("p")
print(title)
intro = '... | 24.3125 | 86 | 0.681234 |
51ce8aa014b8a559db7b304b859c2b71dbf52fa9 | 1,315 | py | Python | test/test_deprecation.py | marrow/schema | e2b16ec45329a646156388936c2e779ddcd8fa77 | [
"MIT"
] | 3 | 2016-09-03T07:00:50.000Z | 2021-06-19T18:52:56.000Z | test/test_deprecation.py | marrow/schema | e2b16ec45329a646156388936c2e779ddcd8fa77 | [
"MIT"
] | 6 | 2015-01-23T19:32:04.000Z | 2019-10-23T15:36:48.000Z | test/test_deprecation.py | marrow/schema | e2b16ec45329a646156388936c2e779ddcd8fa77 | [
"MIT"
] | 2 | 2015-11-13T20:02:17.000Z | 2018-01-30T12:01:47.000Z | import pytest
import warnings
from marrow.schema.util import DeclarativeAttributes
DEPRECATED = (
(DeclarativeAttributes, 'Attributes')
)
@pytest.mark.parametrize("cls,dst", DEPRECATED)
def test_deprecation(cls, dst):
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter('always')
cls()
... | 32.073171 | 107 | 0.769582 |
ca8d49f67e1e2ebdf47424a4b4adfbc3e5c258ea | 3,379 | py | Python | var/spack/repos/builtin/packages/r-scater/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/r-scater/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/r-scater/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RScater(RPackage):
"""Single-Cell Analysis Toolkit for Gene Expression Data in R.
... | 52.796875 | 79 | 0.616751 |
da697f6ce064a840143e9716a71370705cdd7c41 | 10,249 | py | Python | AW_hotkeyEditor.py | boredstiff/MotionBuilderHotkeyEditor | e377103ac194a1da2680006881de25442ae9d6e6 | [
"Apache-2.0"
] | 4 | 2019-01-30T10:41:07.000Z | 2020-07-09T05:45:31.000Z | AW_hotkeyEditor.py | OlafHaag/MotionBuilderHotkeyEditor | 7198dc0bb7cf0c20b505be10fd6c7810bd13e66d | [
"Apache-2.0"
] | null | null | null | AW_hotkeyEditor.py | OlafHaag/MotionBuilderHotkeyEditor | 7198dc0bb7cf0c20b505be10fd6c7810bd13e66d | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Alex Widener
#
# 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... | 38.100372 | 110 | 0.657625 |
4e2cff4603f6bf5faaf96ace9167a3a18949db67 | 15,983 | py | Python | adwords_python3_examples_10.1.0/v201708/migration/migrate_to_extension_settings.py | xyla-io/hazel | 260ce906761d8b808c21ca61b44cc71ca3329e8c | [
"MIT"
] | null | null | null | adwords_python3_examples_10.1.0/v201708/migration/migrate_to_extension_settings.py | xyla-io/hazel | 260ce906761d8b808c21ca61b44cc71ca3329e8c | [
"MIT"
] | null | null | null | adwords_python3_examples_10.1.0/v201708/migration/migrate_to_extension_settings.py | xyla-io/hazel | 260ce906761d8b808c21ca61b44cc71ca3329e8c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 30.270833 | 83 | 0.666208 |
8799d962e142ec22b6af858c6b82565cc104c0b5 | 785 | py | Python | 0x0F-python-object_relational_mapping/9-model_state_filter_a.py | Nahi-Terefe/alx-higher_level_programming | c67a78a6f79e853918963971f8352979e7691541 | [
"MIT"
] | null | null | null | 0x0F-python-object_relational_mapping/9-model_state_filter_a.py | Nahi-Terefe/alx-higher_level_programming | c67a78a6f79e853918963971f8352979e7691541 | [
"MIT"
] | null | null | null | 0x0F-python-object_relational_mapping/9-model_state_filter_a.py | Nahi-Terefe/alx-higher_level_programming | c67a78a6f79e853918963971f8352979e7691541 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""filter all the states that contains the a letter"""
from model_state import Base, State
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import sys
if __name__ == '__main__':
username = sys.argv[1]
password = sys.argv[2]
DB_name = sys.argv[3]
engine =... | 31.4 | 68 | 0.634395 |
68cd6a5ba24c7ca07f40e90158fcb72830f1b248 | 1,746 | py | Python | source/16/mc-16-02-02-esmajor-1white.py | schef/schef.github.io | ac6fc70e5077deeeb8233ede89e0895fdc2a0d05 | [
"MIT"
] | null | null | null | source/16/mc-16-02-02-esmajor-1white.py | schef/schef.github.io | ac6fc70e5077deeeb8233ede89e0895fdc2a0d05 | [
"MIT"
] | null | null | null | source/16/mc-16-02-02-esmajor-1white.py | schef/schef.github.io | ac6fc70e5077deeeb8233ede89e0895fdc2a0d05 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
#import time
import random
import imp
modl = imp.load_source('ppFunctions', '../00/ppFunctions.py')
logo = imp.load_source('logo', '../00/logo.py')
import os
from ppFunctions import *
from termcolor import colored, cprint
os.system('clear')
from logo import *
#sleep becouse of loading midi modules
pr... | 28.16129 | 70 | 0.595647 |
4d4aa98e08158327a5b80e717c9156d507c9e0f0 | 7,613 | py | Python | tests/test_dict_config.py | tirkarthi/twiggy | 054a07e71f2ceae231270fc62cb7f0a59cf72958 | [
"BSD-3-Clause"
] | 36 | 2015-02-06T06:19:27.000Z | 2022-01-31T18:36:22.000Z | tests/test_dict_config.py | tirkarthi/twiggy | 054a07e71f2ceae231270fc62cb7f0a59cf72958 | [
"BSD-3-Clause"
] | 51 | 2015-01-13T18:15:06.000Z | 2021-05-16T06:03:07.000Z | tests/test_dict_config.py | tirkarthi/twiggy | 054a07e71f2ceae231270fc62cb7f0a59cf72958 | [
"BSD-3-Clause"
] | 6 | 2016-05-31T20:11:12.000Z | 2021-09-08T16:37:26.000Z | import copy
import pytest
from six import StringIO
import twiggy
#
# Tests: dict_config
#
VALID_CONFIG = {
'version': '1.0',
'incremental': False,
'outputs': {
'out1': {
'output': 'twiggy.outputs.StreamOutput',
'kwargs': {'stream': 'testing1'},
},
'out2': ... | 31.853556 | 95 | 0.66242 |
32922bccc228897a90e6808876926e0648650612 | 747 | py | Python | test/test_location.py | hazael00/TicketMaster-API-Pro | 44053f16e69ad32bcf0fd9f94f0cd81ea7c4a3e2 | [
"MIT"
] | null | null | null | test/test_location.py | hazael00/TicketMaster-API-Pro | 44053f16e69ad32bcf0fd9f94f0cd81ea7c4a3e2 | [
"MIT"
] | null | null | null | test/test_location.py | hazael00/TicketMaster-API-Pro | 44053f16e69ad32bcf0fd9f94f0cd81ea7c4a3e2 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Ticketmaster Discovery API
Swagger spec based on Ticketmaster Discovery API
OpenAPI spec version: 1.0.0
Contact: git@edward.sh
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
i... | 17.372093 | 68 | 0.677376 |
082854a2d1bf386af47bb0d6a83c248f87931985 | 9,323 | py | Python | nitro/resource/config/network/lacp.py | HanseMerkur/nitro-python | d03eb11f492a35a2a8b2a140322fbce22d25a8f7 | [
"Apache-2.0"
] | 2 | 2020-08-24T18:04:22.000Z | 2020-08-24T18:04:47.000Z | nitro/resource/config/network/lacp.py | HanseMerkur/nitro-python | d03eb11f492a35a2a8b2a140322fbce22d25a8f7 | [
"Apache-2.0"
] | null | null | null | nitro/resource/config/network/lacp.py | HanseMerkur/nitro-python | d03eb11f492a35a2a8b2a140322fbce22d25a8f7 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | 32.943463 | 332 | 0.563874 |
14742f9be18a874f617d88793ec6f22500d2889b | 443 | py | Python | content/images/sync.py | mkgilson/smirnoff-host-guest-manuscript | f9884d3ea4dc3fe4a91f67d8f258d7a75f40e056 | [
"CC-BY-4.0",
"CC0-1.0"
] | null | null | null | content/images/sync.py | mkgilson/smirnoff-host-guest-manuscript | f9884d3ea4dc3fe4a91f67d8f258d7a75f40e056 | [
"CC-BY-4.0",
"CC0-1.0"
] | 1 | 2019-05-18T13:38:56.000Z | 2019-05-18T13:38:56.000Z | content/images/sync.py | mkgilson/smirnoff-host-guest-manuscript | f9884d3ea4dc3fe4a91f67d8f258d7a75f40e056 | [
"CC-BY-4.0",
"CC0-1.0"
] | null | null | null | import os
import glob
import subprocess as sp
for file in glob.glob("*.pdf"):
print(f"Updating {file}")
p = sp.Popen(
[
"cp",
os.path.join(
"..",
"..",
"..",
"projects",
"smirnoff-host-guest-simulati... | 19.26087 | 50 | 0.349887 |
eca19b7ecc97a2f1c184b5e5bebb1974ae938940 | 2,863 | py | Python | experts/bipedal_walker_heuristic.py | cheng-xie/dpgfddagger | 5264d5b9e0ab76fc9620da63bcfd78b25dadcbec | [
"MIT"
] | null | null | null | experts/bipedal_walker_heuristic.py | cheng-xie/dpgfddagger | 5264d5b9e0ab76fc9620da63bcfd78b25dadcbec | [
"MIT"
] | null | null | null | experts/bipedal_walker_heuristic.py | cheng-xie/dpgfddagger | 5264d5b9e0ab76fc9620da63bcfd78b25dadcbec | [
"MIT"
] | null | null | null | import sys, math
import numpy as np
import gym
from gym import spaces
from gym.utils import seeding
STAY_ON_ONE_LEG, PUT_OTHER_DOWN, PUSH_OFF = 1,2,3
SPEED = 0.29 # Will fall forward on higher speed
class BipedalWalkerExpert:
def __init__(self):
self.state = STAY_ON_ONE_LEG
self.moving_leg = 0
... | 38.689189 | 99 | 0.584003 |
5f821d645f27f4b7fef7a3b3d2c26f9cf36acbf6 | 61 | py | Python | LogInDB.py | the-man-with-no-name/encrypted-password-manager | 685545a61e0204102f9cfc4734994c7d1a48cfe0 | [
"MIT"
] | 1 | 2021-03-05T10:49:59.000Z | 2021-03-05T10:49:59.000Z | LogInDB.py | the-man-with-no-name/encrypted-password-manager | 685545a61e0204102f9cfc4734994c7d1a48cfe0 | [
"MIT"
] | null | null | null | LogInDB.py | the-man-with-no-name/encrypted-password-manager | 685545a61e0204102f9cfc4734994c7d1a48cfe0 | [
"MIT"
] | null | null | null | from utils import main
if __name__ == '__main__':
main() | 15.25 | 26 | 0.672131 |
023ddffc828d6ac3758c16a24c23a9171bad21cd | 24,178 | py | Python | python3-alpha/python3-src/Lib/distutils/util.py | stormtheh4ck3r/python-for-android | b9ea9161392f60566b81482b1e25cd77004d5c45 | [
"Apache-2.0"
] | 4 | 2016-05-04T07:05:22.000Z | 2020-09-24T00:21:05.000Z | python3-alpha/python3-src/Lib/distutils/util.py | rockyzhang/zhangyanhit-python-for-android-mips | 799dd5ca16f72135f2eab71e144a68842e2aaee0 | [
"Apache-2.0"
] | null | null | null | python3-alpha/python3-src/Lib/distutils/util.py | rockyzhang/zhangyanhit-python-for-android-mips | 799dd5ca16f72135f2eab71e144a68842e2aaee0 | [
"Apache-2.0"
] | 1 | 2018-12-12T03:06:17.000Z | 2018-12-12T03:06:17.000Z | """distutils.util
Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
"""
import sys, os, string, re
from distutils.errors import DistutilsPlatformError
from distutils.dep_util import newer
from distutils.spawn import spawn
from distutils import log
from distutils.erro... | 37.660436 | 88 | 0.595293 |
ef19360aa9f7d720b2ea56dda738b87cd0e61433 | 1,029 | py | Python | Lib/site-packages/oauth2client/__init__.py | Kronos3/pyexec | c9e76a0302dee047ed137bc38aa669cec04c24cd | [
"bzip2-1.0.6"
] | 78 | 2017-08-19T03:46:13.000Z | 2020-02-19T04:29:45.000Z | Lib/site-packages/oauth2client/__init__.py | Kronos3/pyexec | c9e76a0302dee047ed137bc38aa669cec04c24cd | [
"bzip2-1.0.6"
] | 5 | 2017-08-21T16:33:08.000Z | 2018-06-21T18:37:18.000Z | Lib/site-packages/oauth2client/__init__.py | Kronos3/pyexec | c9e76a0302dee047ed137bc38aa669cec04c24cd | [
"bzip2-1.0.6"
] | 13 | 2017-08-19T16:46:08.000Z | 2018-11-05T23:11:34.000Z | # 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 required by applicable law or ... | 42.875 | 74 | 0.76482 |
a95014bfacaa4a0a2aa865acf6cad3667633022e | 1,911 | py | Python | setup.py | TomekTrzeciak/clize | 4ed5be0eabe67ee5e06173da406899f9aa1c176c | [
"MIT"
] | null | null | null | setup.py | TomekTrzeciak/clize | 4ed5be0eabe67ee5e06173da406899f9aa1c176c | [
"MIT"
] | null | null | null | setup.py | TomekTrzeciak/clize | 4ed5be0eabe67ee5e06173da406899f9aa1c176c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup
with open("README.rst") as fh:
long_description = fh.read()
setup(
name='clize',
version='4.1.1',
description='Turn functions into command-line interfaces',
long_description=long_description,
long_description_content_type='text/x-rst',
l... | 31.327869 | 71 | 0.584511 |
bac2323b157b136a3cc98afddd0ecc8b9ab5e547 | 357 | bzl | Python | src/test/java/com/google/devtools/build/skydoc/testdata/repo_rules_test/input.bzl | zzmp/bazel | e9dfdc510c7d6f0c853e0baad2a10987f47b3f6a | [
"Apache-2.0"
] | 3 | 2019-03-18T23:49:16.000Z | 2021-05-30T09:44:18.000Z | src/test/java/com/google/devtools/build/skydoc/testdata/repo_rules_test/input.bzl | installation00/bazel | 6f38f345a1bd278a71170c5d80aba3928afdc6ec | [
"Apache-2.0"
] | null | null | null | src/test/java/com/google/devtools/build/skydoc/testdata/repo_rules_test/input.bzl | installation00/bazel | 6f38f345a1bd278a71170c5d80aba3928afdc6ec | [
"Apache-2.0"
] | 1 | 2020-11-14T00:11:50.000Z | 2020-11-14T00:11:50.000Z | def _repo_rule_impl(ctx):
ctx.file("BUILD", "")
my_repo = repository_rule(
implementation = _repo_rule_impl,
doc = "Minimal example of a repository rule.",
attrs = {
"useless" : attr.string(
doc = "This argument will be ingored. You don't have to specify it, but you may.",
defa... | 25.5 | 91 | 0.59944 |
9f7aaf87b2f89a0181c1b74c98b80bedc94aa104 | 883 | py | Python | tfx_addons/feature_selection/feature_selection/module_file.py | pratishtha-abrol/tfx-addons | ca9936442d60104e80dd04914e2a6ee6047d0d5c | [
"Apache-2.0"
] | null | null | null | tfx_addons/feature_selection/feature_selection/module_file.py | pratishtha-abrol/tfx-addons | ca9936442d60104e80dd04914e2a6ee6047d0d5c | [
"Apache-2.0"
] | null | null | null | tfx_addons/feature_selection/feature_selection/module_file.py | pratishtha-abrol/tfx-addons | ca9936442d60104e80dd04914e2a6ee6047d0d5c | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 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 applicabl... | 35.32 | 80 | 0.696489 |
9aaf3d488bcd642ef4b085ec5e4d85b4f311fcef | 5,462 | py | Python | redash/query_runner/oracle.py | cemremengu/redash | 25470b11fd7e0e7f452ef1ac52680039a9dc4f23 | [
"BSD-2-Clause"
] | null | null | null | redash/query_runner/oracle.py | cemremengu/redash | 25470b11fd7e0e7f452ef1ac52680039a9dc4f23 | [
"BSD-2-Clause"
] | null | null | null | redash/query_runner/oracle.py | cemremengu/redash | 25470b11fd7e0e7f452ef1ac52680039a9dc4f23 | [
"BSD-2-Clause"
] | null | null | null | import logging
from redash.utils import json_dumps, json_loads
from redash.query_runner import *
try:
import cx_Oracle
TYPES_MAP = {
cx_Oracle.DATETIME: TYPE_DATETIME,
cx_Oracle.CLOB: TYPE_STRING,
cx_Oracle.LOB: TYPE_STRING,
cx_Oracle.FIXED_CHAR: TYPE_STRING,
cx_Oracle... | 31.211429 | 157 | 0.55108 |
d2a9810700e51c2911d70c69124a06fc1f8cca3d | 1,293 | py | Python | text_collector/spiders/aceh_harianrakyat.py | gusman/web-crawler | d7a41cab2ce82d0e6b0daf5db05944381f0a4bbd | [
"MIT"
] | null | null | null | text_collector/spiders/aceh_harianrakyat.py | gusman/web-crawler | d7a41cab2ce82d0e6b0daf5db05944381f0a4bbd | [
"MIT"
] | null | null | null | text_collector/spiders/aceh_harianrakyat.py | gusman/web-crawler | d7a41cab2ce82d0e6b0daf5db05944381f0a4bbd | [
"MIT"
] | null | null | null | import scrapy
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
class ItemNews(scrapy.Item):
date = scrapy.Field()
title = scrapy.Field()
content = scrapy.Field()
class HarianRakyatAcehSpider(CrawlSpider):
stop_flag = False
name = "aceh_harianrakyat"
... | 28.733333 | 81 | 0.512761 |
98cf885c43940cf0ee033f2a2821182c616d9faf | 321 | py | Python | mmdet/core/post_processing/__init__.py | LEOCUIZHIHAO/kpmask | 73fe907b2359b7ddc2927cd325bbbb686eb62ffd | [
"Apache-2.0"
] | 1 | 2021-03-01T08:54:48.000Z | 2021-03-01T08:54:48.000Z | mmdet/core/post_processing/__init__.py | LEOCUIZHIHAO/kpmask | 73fe907b2359b7ddc2927cd325bbbb686eb62ffd | [
"Apache-2.0"
] | null | null | null | mmdet/core/post_processing/__init__.py | LEOCUIZHIHAO/kpmask | 73fe907b2359b7ddc2927cd325bbbb686eb62ffd | [
"Apache-2.0"
] | null | null | null | from .bbox_nms import multiclass_nms, keypoint_box_nms
from .merge_augs import (merge_aug_bboxes, merge_aug_masks,
merge_aug_proposals, merge_aug_scores)
__all__ = [
'multiclass_nms', 'merge_aug_proposals', 'merge_aug_bboxes',
'merge_aug_scores', 'merge_aug_masks', 'keypoint_box_nms'
]... | 35.666667 | 64 | 0.738318 |
c5b2048916f9b81100f28ba5337b850531491955 | 3,964 | py | Python | sentence_generator.py | mafagafogigante/nlp | c37922b69cdce2f3388a90003bca8cc9da36feda | [
"BSD-2-Clause"
] | null | null | null | sentence_generator.py | mafagafogigante/nlp | c37922b69cdce2f3388a90003bca8cc9da36feda | [
"BSD-2-Clause"
] | 5 | 2016-01-17T05:03:11.000Z | 2016-01-17T13:15:02.000Z | sentence_generator.py | mafagafogigante/nlp | c37922b69cdce2f3388a90003bca8cc9da36feda | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
import random
import re
from collections import defaultdict
preposition_list = open('prepositions.txt').read().split('\n')
conjunction_list = open('conjunctions.txt').read().split('\n')
# Improvement: do not keep a bi-gram if the words are separated by a period.
def remove_punctuation(text):
... | 28.724638 | 103 | 0.651867 |
3875cf98756e197f1fe2dec8bdae4ac783b370b6 | 1,223 | py | Python | var/spack/repos/builtin/packages/r-reshape2/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-reshape2/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/r-reshape2/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RReshape2(RPackage):
"""Flexibly Reshape Data: A Reboot of the Reshape Package
Flexib... | 43.678571 | 95 | 0.727719 |
7b78568da58e08a5eee2bb5ecbbe0cf669af5a8f | 1,636 | py | Python | agents/actor.py | jscriptcoder/SpaceX-Falcon-Landing-PG | 70b8286f9e770c1a96571c783f9e897ddcd3c06f | [
"MIT"
] | null | null | null | agents/actor.py | jscriptcoder/SpaceX-Falcon-Landing-PG | 70b8286f9e770c1a96571c783f9e897ddcd3c06f | [
"MIT"
] | null | null | null | agents/actor.py | jscriptcoder/SpaceX-Falcon-Landing-PG | 70b8286f9e770c1a96571c783f9e897ddcd3c06f | [
"MIT"
] | 1 | 2020-11-30T13:27:58.000Z | 2020-11-30T13:27:58.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal
from .device import device
class Actor(nn.Module):
def __init__(self, state_size, action_size, hidden_size, activ, std=1.0):
super().__init__()
dims = (state_size,) + hidden_size + (a... | 31.461538 | 94 | 0.551956 |
dd214316ee717bb78888eeaa8babce1f1f3bf85e | 1,190 | py | Python | code and data/Optimisation.py | HaloNee/Portfolio_optimization | 5cfbdea150daf0a9cb9cb9198f1267cfa2c5ffda | [
"Apache-2.0"
] | null | null | null | code and data/Optimisation.py | HaloNee/Portfolio_optimization | 5cfbdea150daf0a9cb9cb9198f1267cfa2c5ffda | [
"Apache-2.0"
] | null | null | null | code and data/Optimisation.py | HaloNee/Portfolio_optimization | 5cfbdea150daf0a9cb9cb9198f1267cfa2c5ffda | [
"Apache-2.0"
] | null | null | null | import pathlib
import numpy as np
import pandas as pd
import datetime
import matplotlib.pyplot as plt
import portfolio as pf
# read data from files:
df_data_path = pathlib.Path.cwd()/ "data" / "close_data_201801.csv"
df_data = pd.read_csv(df_data_path, index_col="Date", parse_dates=True)
# building a portfolio
mypf... | 24.791667 | 74 | 0.756303 |
35720a2924773c8654d3718301b13db4d9f665b7 | 5,941 | py | Python | wechatpy/messages.py | xxiiaaon/wechatpy | 1ba34b4eb7f544e69dbc4b263ef4ac77de166d52 | [
"MIT"
] | null | null | null | wechatpy/messages.py | xxiiaaon/wechatpy | 1ba34b4eb7f544e69dbc4b263ef4ac77de166d52 | [
"MIT"
] | null | null | null | wechatpy/messages.py | xxiiaaon/wechatpy | 1ba34b4eb7f544e69dbc4b263ef4ac77de166d52 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
wechatpy.messages
~~~~~~~~~~~~~~~~~~
This module defines all the messages you can get from WeChat server
:copyright: (c) 2014 by messense.
:license: MIT, see LICENSE for more details.
"""
import copy
from wechatpy.fields import BaseField, DateTimeField, FieldDescriptor... | 24.24898 | 104 | 0.684733 |
692e22320e882151d47fc74ee4cd04080fc1699a | 2,491 | py | Python | day22/day22.py | alexmotoc/AoC17 | c496b1da3a5863b370e677b87b6f14c65863227c | [
"MIT"
] | null | null | null | day22/day22.py | alexmotoc/AoC17 | c496b1da3a5863b370e677b87b6f14c65863227c | [
"MIT"
] | null | null | null | day22/day22.py | alexmotoc/AoC17 | c496b1da3a5863b370e677b87b6f14c65863227c | [
"MIT"
] | null | null | null | from collections import defaultdict
def turn_left(face):
"""Return the new facing position after turning left"""
updated = face
if face == 'N':
updated = 'W'
elif face == 'S':
updated = 'E'
elif face == 'E':
updated = 'N'
elif face == 'W':
updated = 'S'
ret... | 21.850877 | 66 | 0.559213 |
53f3ad20198e90239cfbdc2ba0eb13f4e69bca8b | 5,906 | py | Python | program2/kirsch_compass_gradient.py | mfsuve/ComputerVision | d5552ca90bfa949b012f4bd77ff854d2350e09e2 | [
"MIT"
] | null | null | null | program2/kirsch_compass_gradient.py | mfsuve/ComputerVision | d5552ca90bfa949b012f4bd77ff854d2350e09e2 | [
"MIT"
] | null | null | null | program2/kirsch_compass_gradient.py | mfsuve/ComputerVision | d5552ca90bfa949b012f4bd77ff854d2350e09e2 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from matplotlib import pyplot as plt
from math import sqrt
def initFilters():
N = np.array([-3, -3, -3, -3, 0, -3, 5, 5, 5]).reshape(3, 3)
W = np.array([-3, -3, 5, -3, 0, 5, -3, -3, 5]).reshape(3, 3)
S = np.array([5, 5, 5, -3, 0, -3, -3, -3, -3]).reshape(3, 3)
E = np.array... | 29.979695 | 106 | 0.525737 |
5cc3a0e18b236c8dcf2155b00c502133d2d6c755 | 4,103 | py | Python | wpa_supplicant/examples/p2p/p2p_flush.py | byu343/sonic-wpa-supplicant | 447e9f708df996b8de88ce4fe703c0901357e12b | [
"Unlicense"
] | 1,104 | 2021-05-11T18:45:36.000Z | 2022-03-30T22:39:34.000Z | wpa_supplicant/examples/p2p/p2p_flush.py | byu343/sonic-wpa-supplicant | 447e9f708df996b8de88ce4fe703c0901357e12b | [
"Unlicense"
] | 44 | 2021-05-12T01:12:58.000Z | 2022-03-31T07:09:52.000Z | wpa_supplicant/examples/p2p/p2p_flush.py | byu343/sonic-wpa-supplicant | 447e9f708df996b8de88ce4fe703c0901357e12b | [
"Unlicense"
] | 168 | 2021-05-11T22:02:54.000Z | 2022-03-24T03:21:51.000Z | #!/usr/bin/python
# Tests P2P_Flush
# Will flush the p2p interface
# Then Program will exit
######### MAY NEED TO RUN AS SUDO #############
import dbus
import sys, os
import time
import gobject
import threading
import getopt
from dbus.mainloop.glib import DBusGMainLoop
def usage():
print("Usage:")
print(" %s -i <i... | 24.278107 | 73 | 0.728248 |
5b4286db8146d05bb9275efce34062e0221d6936 | 26,704 | py | Python | src/transformers/generation_logits_process.py | severinsimmler/transformers | 1a3e0c4fe6868b4eb1105dfe601a79d7e5d11a0f | [
"Apache-2.0"
] | 1 | 2021-03-31T02:23:56.000Z | 2021-03-31T02:23:56.000Z | src/transformers/generation_logits_process.py | severinsimmler/transformers | 1a3e0c4fe6868b4eb1105dfe601a79d7e5d11a0f | [
"Apache-2.0"
] | null | null | null | src/transformers/generation_logits_process.py | severinsimmler/transformers | 1a3e0c4fe6868b4eb1105dfe601a79d7e5d11a0f | [
"Apache-2.0"
] | 1 | 2020-11-02T06:37:04.000Z | 2020-11-02T06:37:04.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team
#
# 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 ... | 44.730318 | 156 | 0.673907 |
f93379a5c6fcf46c34f07c556e3c89e502141bd4 | 308 | py | Python | treebankanalytics/formatters/csvformatter.py | Cocophotos/TreebankAnalytics | cf45e24cecb0b187a9b6ec5a55a836c7ab5ffb01 | [
"MIT"
] | 2 | 2015-10-28T21:12:36.000Z | 2016-09-08T14:00:41.000Z | treebankanalytics/formatters/csvformatter.py | Cocophotos/TreebankAnalytics | cf45e24cecb0b187a9b6ec5a55a836c7ab5ffb01 | [
"MIT"
] | null | null | null | treebankanalytics/formatters/csvformatter.py | Cocophotos/TreebankAnalytics | cf45e24cecb0b187a9b6ec5a55a836c7ab5ffb01 | [
"MIT"
] | null | null | null | import io
__all__ = ['CSVFormatter']
class CSVFormatter(object):
def __init__(self):
pass
def format(self, table):
output = io.StringIO()
for row in table:
print('\t'.join(row), file=output)
c = output.getvalue()
output.close()
return c
| 19.25 | 46 | 0.558442 |
fdc5769788f9cf5d4563284bc87a4b39ba1bae64 | 2,518 | py | Python | test/check-exercises.py | kishankj/python | 82042de746128127502e109111e6c4e8ab002af6 | [
"MIT"
] | 1 | 2020-11-02T10:40:42.000Z | 2020-11-02T10:40:42.000Z | test/check-exercises.py | kishankj/python | 82042de746128127502e109111e6c4e8ab002af6 | [
"MIT"
] | 1 | 2019-07-23T14:55:16.000Z | 2019-07-23T16:58:25.000Z | test/check-exercises.py | kishankj/python | 82042de746128127502e109111e6c4e8ab002af6 | [
"MIT"
] | 1 | 2020-11-02T10:40:06.000Z | 2020-11-02T10:40:06.000Z | #!/usr/bin/env python3
import os
import glob
import shutil
import subprocess
import sys
import tempfile
import json
# Allow high-performance tests to be skipped
ALLOW_SKIP = ['alphametics', 'largest-series-product']
def check_assignment(name, test_file):
# Returns the exit code of the tests
workdir = tempfi... | 29.623529 | 79 | 0.603257 |
6dfe1f353923cc15e0b3df4a53aa5c877aece6b2 | 284 | py | Python | tweaktime/conftest.py | black-redoc/tweaktime | a185990760a007a72f73eea6743b8ac29c889a96 | [
"MIT"
] | null | null | null | tweaktime/conftest.py | black-redoc/tweaktime | a185990760a007a72f73eea6743b8ac29c889a96 | [
"MIT"
] | null | null | null | tweaktime/conftest.py | black-redoc/tweaktime | a185990760a007a72f73eea6743b8ac29c889a96 | [
"MIT"
] | null | null | null | import pytest
from tweaktime.users.models import User
from tweaktime.users.tests.factories import UserFactory
@pytest.fixture(autouse=True)
def media_storage(settings, tmpdir):
settings.MEDIA_ROOT = tmpdir.strpath
@pytest.fixture
def user() -> User:
return UserFactory()
| 18.933333 | 55 | 0.778169 |
b93e38eaf2dc3882a7395a3a49594c71359d35f7 | 2,174 | py | Python | google/ads/google_ads/v4/proto/services/currency_constant_service_pb2_grpc.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v4/proto/services/currency_constant_service_pb2_grpc.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v4/proto/services/currency_constant_service_pb2_grpc.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.ads.google_ads.v4.proto.resources import currency_constant_pb2 as google_dot_ads_dot_googleads__v4_dot_proto_dot_resources_dot_currency__constant__pb2
from google.ads.google_ads.v4.proto.services import currency_constant_serv... | 45.291667 | 177 | 0.821527 |
b0a3185ae6f29332c9f55bf5143e594bffc569eb | 1,777 | py | Python | magnum/tests/unit/conductor/test_k8s_api.py | mjbrewer/testIndex | 420dc071d4240a89b6f266e8d2575cedb39bfea0 | [
"Apache-2.0"
] | null | null | null | magnum/tests/unit/conductor/test_k8s_api.py | mjbrewer/testIndex | 420dc071d4240a89b6f266e8d2575cedb39bfea0 | [
"Apache-2.0"
] | null | null | null | magnum/tests/unit/conductor/test_k8s_api.py | mjbrewer/testIndex | 420dc071d4240a89b6f266e8d2575cedb39bfea0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Huawei Technologies Co.,LTD.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 35.54 | 75 | 0.704558 |
2f057dbaccc4a2196e18558418de71ed80ae3896 | 769 | py | Python | rectangle.py | rokimaru/oop_geometric_figures | 180b588658ee1434a4061c571ebf2c64e99e2297 | [
"Apache-2.0"
] | null | null | null | rectangle.py | rokimaru/oop_geometric_figures | 180b588658ee1434a4061c571ebf2c64e99e2297 | [
"Apache-2.0"
] | null | null | null | rectangle.py | rokimaru/oop_geometric_figures | 180b588658ee1434a4061c571ebf2c64e99e2297 | [
"Apache-2.0"
] | null | null | null | from figure import BaseFigure
class Rectangle(BaseFigure):
""" Класс с переменными и методами геометрической фигуры "прямоугольник" """
def __init__(self, side_a, side_b):
""" Метод-инициализатор класса "прямоугольник" """
self.name = 'Rectangle'
self.angles = 4
self.side_a =... | 27.464286 | 80 | 0.639792 |
5d187d8c34d66b68a74c763c4857aedbaf28dfb8 | 21,980 | py | Python | lib/JobBrowserBFF/JobBrowserBFFImpl.py | eapearson/kbase-skd-module-job-browser-bff | 426445f90569adac16632ef4921f174e51abd42f | [
"MIT"
] | null | null | null | lib/JobBrowserBFF/JobBrowserBFFImpl.py | eapearson/kbase-skd-module-job-browser-bff | 426445f90569adac16632ef4921f174e51abd42f | [
"MIT"
] | 6 | 2020-05-26T17:40:07.000Z | 2022-03-11T16:33:11.000Z | lib/JobBrowserBFF/JobBrowserBFFImpl.py | eapearson/kbase-skd-module-job-browser-bff | 426445f90569adac16632ef4921f174e51abd42f | [
"MIT"
] | 1 | 2020-05-26T17:12:59.000Z | 2020-05-26T17:12:59.000Z | # -*- coding: utf-8 -*-
# BEGIN_HEADER
import apsw
import logging
from JobBrowserBFF.Validation import Validation
from JobBrowserBFF.model.Model import Model
from JobBrowserBFF.definitions.Definitions import Definitions
from JobBrowserBFF.cache.AppCache import AppCache
from JobBrowserBFF.cache.UserProfileCache import U... | 48.414097 | 80 | 0.631938 |
fefa1a8f8b42e5cfcd4daade726378deffea990a | 51,430 | py | Python | ghidra_9.0/Ghidra/Features/Python/data/jython-2.7.1/Lib/compiler/transformer.py | ChristopherMorrison/ghidra | e53aa57d1aff79a1df93728f746705c58fe95ab0 | [
"Apache-2.0"
] | 577 | 2020-06-04T16:34:44.000Z | 2022-03-31T11:46:07.000Z | ghidra_9.0/Ghidra/Features/Python/data/jython-2.7.1/Lib/compiler/transformer.py | ChristopherMorrison/ghidra | e53aa57d1aff79a1df93728f746705c58fe95ab0 | [
"Apache-2.0"
] | 174 | 2015-01-08T20:37:09.000Z | 2020-06-03T16:48:59.000Z | ghidra_9.0/Ghidra/Features/Python/data/jython-2.7.1/Lib/compiler/transformer.py | ChristopherMorrison/ghidra | e53aa57d1aff79a1df93728f746705c58fe95ab0 | [
"Apache-2.0"
] | 162 | 2015-02-07T02:14:38.000Z | 2020-05-30T16:42:03.000Z | """Parse tree transformation module.
Transforms Python source code into an abstract syntax tree (AST)
defined in the ast module.
The simplest ways to invoke this module are via parse and parseFile.
parse(buf) -> AST
parseFile(path) -> AST
"""
# Original version written by Greg Stein (gstein@lyra.org)
# ... | 34.470509 | 99 | 0.530935 |
c70ff5ae80a08971f39c04d9258e598cdec06831 | 6,378 | py | Python | tests/test_blake3.py | xkortex/blake3-py | 2a96fd27ad4c9bbba0d1168eb1496a18381017ab | [
"Apache-2.0"
] | null | null | null | tests/test_blake3.py | xkortex/blake3-py | 2a96fd27ad4c9bbba0d1168eb1496a18381017ab | [
"Apache-2.0"
] | null | null | null | tests/test_blake3.py | xkortex/blake3-py | 2a96fd27ad4c9bbba0d1168eb1496a18381017ab | [
"Apache-2.0"
] | null | null | null | import array
from binascii import unhexlify
import json
import numpy
from pathlib import Path
import subprocess
import sys
try:
from blake3 import blake3
except ModuleNotFoundError:
print("Run tests/build.py first.", file=sys.stderr)
raise
HERE = Path(__file__).parent
VECTORS = json.load((HERE / "test_ve... | 34.475676 | 80 | 0.65773 |
a23769ad1636dac6b1a645ab8e2b01866a490245 | 12,038 | py | Python | ewah/operators/sql_base_operator.py | sdaltmann/ewah | 0615af0e1f1825a91258b79fdbf3c2e3a27cb4b8 | [
"MIT"
] | null | null | null | ewah/operators/sql_base_operator.py | sdaltmann/ewah | 0615af0e1f1825a91258b79fdbf3c2e3a27cb4b8 | [
"MIT"
] | null | null | null | ewah/operators/sql_base_operator.py | sdaltmann/ewah | 0615af0e1f1825a91258b79fdbf3c2e3a27cb4b8 | [
"MIT"
] | null | null | null | from ewah.operators.base_operator import EWAHBaseOperator
from ewah.ewah_utils.airflow_utils import airflow_datetime_adjustments
from ewah.constants import EWAHConstants as EC
from datetime import timedelta
from pytz import timezone
class EWAHSQLBaseOperator(EWAHBaseOperator):
template_fields = ('data_from', 'da... | 44.420664 | 80 | 0.543695 |
24c8c6989230799a9ad444daa7991d06c351bde1 | 1,518 | py | Python | server.py | framon/cloudprint | de6595e3aea40a6b96c3efb4f7ba37ace2a61122 | [
"MIT"
] | null | null | null | server.py | framon/cloudprint | de6595e3aea40a6b96c3efb4f7ba37ace2a61122 | [
"MIT"
] | null | null | null | server.py | framon/cloudprint | de6595e3aea40a6b96c3efb4f7ba37ace2a61122 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# (c) Fábio Ramon Lima e Lima - 2012
# framon@monzeu.eti.br
import web
import subprocess
class Printer:
def __init__ (self, name):
self.name = name
self.location = ''
self.description = ''
class PrintersHandler:
def GET(self, slash):
if slash:
raise web.seeother('/printers')
... | 19.461538 | 70 | 0.670619 |
b57d6e202f1b8b4f2bbd85ab8f3f18f4b8a2e449 | 8,428 | py | Python | adafruit_ht16k33/matrix.py | FoamyGuy/Adafruit_CircuitPython_HT16K33 | fc0fd184e96494f0f44b3baba726f951ce291b05 | [
"MIT"
] | null | null | null | adafruit_ht16k33/matrix.py | FoamyGuy/Adafruit_CircuitPython_HT16K33 | fc0fd184e96494f0f44b3baba726f951ce291b05 | [
"MIT"
] | null | null | null | adafruit_ht16k33/matrix.py | FoamyGuy/Adafruit_CircuitPython_HT16K33 | fc0fd184e96494f0f44b3baba726f951ce291b05 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2016 Radomir Dopieralski & Tony DiCola for Adafruit Industries
#
# 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 witho... | 36.017094 | 93 | 0.556834 |
30fbd96bb24a584662e869b262541ae4afc32be4 | 7,036 | py | Python | game/user.py | matthewjwhite/crystal-skull | d2702275bb96ab2b18d7f99e89837854a387532b | [
"MIT"
] | null | null | null | game/user.py | matthewjwhite/crystal-skull | d2702275bb96ab2b18d7f99e89837854a387532b | [
"MIT"
] | 5 | 2020-12-21T16:28:00.000Z | 2020-12-23T09:54:30.000Z | game/user.py | matthewjwhite/crystal-skull | d2702275bb96ab2b18d7f99e89837854a387532b | [
"MIT"
] | null | null | null | ''' Code related to user accounts '''
import base64
import copy
import random
import uuid
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5
import pymongo
from game.config import Config
from game.entity import Entity
from game.map import Location, Map
from game.constants import \
DB_NAME, DB_... | 32.878505 | 91 | 0.584991 |
b00e728c3509309fc68e8b31b4ebcc06f139da4c | 12,705 | py | Python | fhirclient/models/capabilitystatement_tests.py | zzhou41/client-py | cbfa8d7c7f1bad233b237b7c5582fc0577b21f70 | [
"Apache-2.0"
] | null | null | null | fhirclient/models/capabilitystatement_tests.py | zzhou41/client-py | cbfa8d7c7f1bad233b237b7c5582fc0577b21f70 | [
"Apache-2.0"
] | null | null | null | fhirclient/models/capabilitystatement_tests.py | zzhou41/client-py | cbfa8d7c7f1bad233b237b7c5582fc0577b21f70 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-07-29.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import capabilitystatement
from .fhirdate import FHIRDate
class CapabilityStatementTests(unittest.TestCase):
def instantiate_fro... | 71.376404 | 275 | 0.707281 |
f380f8ada801beac3f8215b3c34d8a435455a68f | 268 | py | Python | app/user/urls.py | Ivanrputra/recipe-app-api | e70548a4f7f8756f8f4224dcf39b809a8b546da1 | [
"MIT"
] | null | null | null | app/user/urls.py | Ivanrputra/recipe-app-api | e70548a4f7f8756f8f4224dcf39b809a8b546da1 | [
"MIT"
] | null | null | null | app/user/urls.py | Ivanrputra/recipe-app-api | e70548a4f7f8756f8f4224dcf39b809a8b546da1 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'user'
urlpatterns = [
path('create/',views.CreateUserView.as_view(),name='create'),
path('token/',views.CreateTokenView.as_view(),name='token'),
path('me/',views.ManageUserView.as_view(),name='me'),
]
| 22.333333 | 62 | 0.712687 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.