hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 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 4 247 | max_forks_repo_name stringlengths 4 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ba156beb04b99754b5ff29ec37e1bcc01509b22c | 2,838 | py | Python | swam/src/mavros_set_home.py | donghee/swam-indoor-flight | bad8adce428e0adacb0f4110ca5739f31a9a11f8 | [
"Apache-2.0"
] | null | null | null | swam/src/mavros_set_home.py | donghee/swam-indoor-flight | bad8adce428e0adacb0f4110ca5739f31a9a11f8 | [
"Apache-2.0"
] | null | null | null | swam/src/mavros_set_home.py | donghee/swam-indoor-flight | bad8adce428e0adacb0f4110ca5739f31a9a11f8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
##
#
# Send SET_GPS_GLOBAL_ORIGIN and SET_HOME_POSITION messages
#
##
import rospy
from pymavlink.dialects.v10 import ardupilotmega as MAV_APM
from mavros.mavlink import convert_to_rosmsg
def send_message(msg, mav, pub):
"""
Send a mavlink message
"""
msg.pack(mav)
rosmsg =... | 22.704 | 76 | 0.582805 | #!/usr/bin/env python
##
#
# Send SET_GPS_GLOBAL_ORIGIN and SET_HOME_POSITION messages
#
##
import rospy
from pymavlink.dialects.v10 import ardupilotmega as MAV_APM
from mavros.mavlink import convert_to_rosmsg
from mavros_msgs.msg import Mavlink
class fifo(object):
""" A simple buffer """
def __init__(self)... | 0 | 0 | 0 | 200 | 0 | 578 | 0 | 14 | 68 |
c71a1bff4f3192e1d1ec8a670f9e040c334dc954 | 3,344 | py | Python | tests/clims/api/serializers/models/test_process_definition.py | commonlims/commonlims | 36a02ed244c7b59ee1f2523e64e4749e404ab0f7 | [
"BSD-3-Clause"
] | 4 | 2019-05-27T13:55:07.000Z | 2021-03-30T07:05:09.000Z | tests/clims/api/serializers/models/test_process_definition.py | commonlims/commonlims | 36a02ed244c7b59ee1f2523e64e4749e404ab0f7 | [
"BSD-3-Clause"
] | 99 | 2019-05-20T14:16:33.000Z | 2021-01-19T09:25:15.000Z | tests/clims/api/serializers/models/test_process_definition.py | commonlims/commonlims | 36a02ed244c7b59ee1f2523e64e4749e404ab0f7 | [
"BSD-3-Clause"
] | 1 | 2020-08-10T07:55:40.000Z | 2020-08-10T07:55:40.000Z | from __future__ import absolute_import
expected_sequence_simple = {
'id':
u'clims.plugins.demo.dnaseq.workflows.sequence.SequenceSimple',
'fields': [{
'label': u'Comment',
'help': None,
'required': False,
'choices': [],
'type': u'textarea',
'name': u'commen... | 32.466019 | 87 | 0.566089 | from __future__ import absolute_import
from tests.clims.models.test_substance import SubstanceTestCase
from clims.plugins.demo.dnaseq.workflows.sequence import SequenceSimple
from clims.api.serializers.models.process_definition import ProcessDefinitionSerializer
class ProcessDefinitionSerializerTest(SubstanceTestCas... | 0 | 0 | 0 | 215 | 0 | 0 | 0 | 158 | 90 |
6ce3cc168aa038a313b9bba66d4ce994e8318fc9 | 2,306 | py | Python | app/__init__.py | x14119641/tracker | bd16897848c23c461d5d4b7a353eedd8f17367a6 | [
"MIT"
] | null | null | null | app/__init__.py | x14119641/tracker | bd16897848c23c461d5d4b7a353eedd8f17367a6 | [
"MIT"
] | null | null | null | app/__init__.py | x14119641/tracker | bd16897848c23c461d5d4b7a353eedd8f17367a6 | [
"MIT"
] | null | null | null | from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from logging.handlers import RotatingFileHandler
from flask_mail import Mail
import logging, os
app = Flask(__name__)
app.config.from_object(Config)
db = SQL... | 36.603175 | 183 | 0.666522 | from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from logging.handlers import SMTPHandler,RotatingFileHandler
from flask_mail import Mail, Message
import logging,os, smtplib
from threading import Thread
app... | 0 | 0 | 0 | 476 | 0 | 0 | 0 | 53 | 68 |
10521b97d7d1e032daf03879ad3e7c6638f79485 | 1,526 | py | Python | Python Fundamentals/Regular Expressions/More Exercises/Task02_3.py | DonikaChervenkova/SoftUni | bff579c037ec48f39ed193b34bc3502a32e90732 | [
"MIT"
] | 1 | 2022-03-16T10:23:04.000Z | 2022-03-16T10:23:04.000Z | Python Fundamentals/Regular Expressions/More Exercise/Task02_02.py | IvanTodorovBG/SoftUni | 7b667f6905d9f695ab1484efbb02b6715f6d569e | [
"MIT"
] | null | null | null | Python Fundamentals/Regular Expressions/More Exercise/Task02_02.py | IvanTodorovBG/SoftUni | 7b667f6905d9f695ab1484efbb02b6715f6d569e | [
"MIT"
] | 1 | 2021-12-04T12:30:57.000Z | 2021-12-04T12:30:57.000Z | import re
data = input()
total_income = 0
while data != "end of shift":
pattern_customer = r"\%(?P<customer>[A-Z][a-z]+)\%"
customer = re.finditer(pattern_customer, data)
is_customer = bool([c.group(0) for c in customer])
pattern_product = r"\<(?P<product>[0-9a-zA-Z\_]+)\>"
product = re.finditer(... | 31.791667 | 100 | 0.619921 | import re
data = input()
total_income = 0
while data != "end of shift":
pattern_customer = r"\%(?P<customer>[A-Z][a-z]+)\%"
customer = re.finditer(pattern_customer, data)
is_customer = bool([c.group(0) for c in customer])
pattern_product = r"\<(?P<product>[0-9a-zA-Z\_]+)\>"
product = re.finditer(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3655fbbcf0aa34a78e5e06dada0505806b450706 | 789 | py | Python | drawShapes.py | Shubhra1906/OpenCV | dc2b3291562bab54506380c52ac74ecb06adb8d3 | [
"MIT"
] | null | null | null | drawShapes.py | Shubhra1906/OpenCV | dc2b3291562bab54506380c52ac74ecb06adb8d3 | [
"MIT"
] | null | null | null | drawShapes.py | Shubhra1906/OpenCV | dc2b3291562bab54506380c52ac74ecb06adb8d3 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
drawShapes()
| 27.206897 | 71 | 0.567807 | import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
def drawShapes():
image = cv.imread('./img/sea.jpg')
# img = np.zeros([600, 800, 3], np.uint8)
# line
image = cv.line(image, (40, 100), (255, 255), (0, 0, 255), 5)
# Arrowed Line
image = cv.arrowedLine(image, (0, 255), (5... | 0 | 0 | 0 | 0 | 0 | 646 | 0 | 7 | 89 |
7eedddac8d7d9c1d55b9ac6e1b3b84147bbbd112 | 28 | py | Python | storedisagg/example/__init__.py | mcsoini/storedisagg | 3fa360234995cdee897122ea8d85bc8658229053 | [
"MIT"
] | null | null | null | storedisagg/example/__init__.py | mcsoini/storedisagg | 3fa360234995cdee897122ea8d85bc8658229053 | [
"MIT"
] | null | null | null | storedisagg/example/__init__.py | mcsoini/storedisagg | 3fa360234995cdee897122ea8d85bc8658229053 | [
"MIT"
] | null | null | null |
__all__ = ['example_data']
| 9.333333 | 26 | 0.678571 |
__all__ = ['example_data']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a39283f2f128ca0dec249a7d9063c5194c19d4e4 | 3,090 | py | Python | loanPrediction3/src_old/ensemble.py | MayukhSobo/AnalyticsVidya_Contests | a21079f8d217a35e88e72e88233c7ef0b8dd348b | [
"BSD-3-Clause"
] | 11 | 2017-09-22T08:12:04.000Z | 2021-10-30T14:30:44.000Z | loanPrediction3/src_old/ensemble.py | Manish041997/AnalyticsVidya_Contests | a21079f8d217a35e88e72e88233c7ef0b8dd348b | [
"BSD-3-Clause"
] | null | null | null | loanPrediction3/src_old/ensemble.py | Manish041997/AnalyticsVidya_Contests | a21079f8d217a35e88e72e88233c7ef0b8dd348b | [
"BSD-3-Clause"
] | 5 | 2017-10-03T12:09:11.000Z | 2019-08-03T14:05:47.000Z | from xgboost.sklearn import XGBClassifier
# from xgb_model import xgb_model_fit
# from sklearn.grid_search import GridSearchCV
from sklearn.ensemble import VotingClassifier
import pandas as pd
import numpy as np
from sklearn.ensemble import AdaBoostClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn... | 27.589286 | 122 | 0.733333 | from xgboost.sklearn import XGBClassifier
# from xgb_model import xgb_model_fit
# from sklearn.grid_search import GridSearchCV
from sklearn.ensemble import VotingClassifier
from sklearn.metrics import accuracy_score
import pandas as pd
from sklearn.model_selection import train_test_split
import numpy as np
from sklearn... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 52 | 44 |
442885ee6cfa521582e9f66dbef3c77656fe3fce | 11,656 | py | Python | data/format_wikibio.py | KaijuML/dtt-multi-branch | a49850a95034e58d387b9d48c647cfc2b83c45b5 | [
"Apache-2.0"
] | 8 | 2021-02-25T08:19:55.000Z | 2022-03-12T06:25:36.000Z | data/format_wikibio.py | KaijuML/dtt-multi-branch | a49850a95034e58d387b9d48c647cfc2b83c45b5 | [
"Apache-2.0"
] | 5 | 2021-05-20T19:11:58.000Z | 2021-07-14T07:46:33.000Z | data/format_wikibio.py | KaijuML/dtt-multi-branch | a49850a95034e58d387b9d48c647cfc2b83c45b5 | [
"Apache-2.0"
] | null | null | null |
import pkg_resources
import re, time, os
import itertools
import argparse
import json
DELIM = u"" # delim used by onmt
def split_infobox(dataset_folder, destination_folder):
"""
extract box content, field type and position information from infoboxes from original_data
*.box.val is the box content (toke... | 41.187279 | 105 | 0.573267 | from utils import nwise
import pkg_resources
import re, time, os
import itertools
import argparse
import numpy
import json
DELIM = u"│" # delim used by onmt
def split_infobox(dataset_folder, destination_folder):
"""
extract box content, field type and position information from infoboxes from original_data
... | 3 | 0 | 0 | 0 | 0 | 4,711 | 0 | -7 | 159 |
26cc0c3344909259086172abac7c8974633f63f8 | 6,039 | py | Python | recalibration.py | DanielAndreasen/pymoog | 1d4042705c5180a6e609d08e7455d3d893e86392 | [
"MIT"
] | null | null | null | recalibration.py | DanielAndreasen/pymoog | 1d4042705c5180a6e609d08e7455d3d893e86392 | [
"MIT"
] | 3 | 2015-01-31T15:36:38.000Z | 2015-07-06T22:11:42.000Z | recalibration.py | DanielAndreasen/pymoog | 1d4042705c5180a6e609d08e7455d3d893e86392 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf8 -*-
# My imports
from __future__ import division
import numpy as np
import pandas as pd
import argparse
from utils import _update_par as updateBatch
from utils import _run_moog as runMoog
from utils import Readmoog
from interpolation import interpolator
import os
def solar_ab... | 37.04908 | 133 | 0.560689 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# My imports
from __future__ import division
import numpy as np
import pandas as pd
import argparse
from utils import _update_par as updateBatch
from utils import _run_moog as runMoog
from utils import Readmoog
from interpolation import interpolator
import os
def solar_ab... | 0 | 0 | 0 | 0 | 0 | 1,357 | 0 | 0 | 50 |
1b7145ed8bd88d7082cc74667eb42dcf2d744fe3 | 3,103 | py | Python | armi/bookkeeping/db/database.py | celikten/armi | 4e100dd514a59caa9c502bd5a0967fd77fdaf00e | [
"Apache-2.0"
] | 1 | 2021-05-29T16:02:31.000Z | 2021-05-29T16:02:31.000Z | armi/bookkeeping/db/database.py | celikten/armi | 4e100dd514a59caa9c502bd5a0967fd77fdaf00e | [
"Apache-2.0"
] | null | null | null | armi/bookkeeping/db/database.py | celikten/armi | 4e100dd514a59caa9c502bd5a0967fd77fdaf00e | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 TerraPower, LLC
#
# 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 writi... | 34.865169 | 88 | 0.682565 | # Copyright 2019 TerraPower, LLC
#
# 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 writi... | 0 | 0 | 0 | 2,381 | 0 | 0 | 0 | 52 | 90 |
eb785d59f66731316d04178e89fe3c2b7adfe88a | 7,697 | py | Python | src/kogniserver/adm.py | aleneum/rsb-wamp-bridge | 4c6401f9f1997294b5891fa814e700986612ebdb | [
"MIT"
] | null | null | null | src/kogniserver/adm.py | aleneum/rsb-wamp-bridge | 4c6401f9f1997294b5891fa814e700986612ebdb | [
"MIT"
] | 2 | 2016-08-05T13:52:45.000Z | 2016-08-05T14:16:42.000Z | src/kogniserver/adm.py | aleneum/kogniserver | 4c6401f9f1997294b5891fa814e700986612ebdb | [
"MIT"
] | null | null | null |
CONFIG_JSON = """
{
"version": 2,
"controller": {},
"workers": [
{
"transports": [
{
"paths": {
"ws": {
"type": "websocket"
},
"/": {
"directory": ".",
"type": "static"
},
"proto"... | 33.176724 | 121 | 0.509809 | import argparse
from os import makedirs
from os.path import abspath, exists, join, dirname, expanduser
import re
import subprocess
import time
import json
import threading
import socket
import sys
def run_crossbar(config_path, keep_alive):
ret = subprocess.call(['crossbar', 'status'])
if ret == 0 and not keep... | 0 | 0 | 0 | 0 | 0 | 5,950 | 0 | -23 | 289 |
8c8034428e29fd160cf8e41c0c7d98c8aa53bb4b | 1,867 | py | Python | 10205/10205.py | Keilan/uva | 4218328466c3ab2fdf34cdf45fc7a8dea90964bc | [
"MIT"
] | null | null | null | 10205/10205.py | Keilan/uva | 4218328466c3ab2fdf34cdf45fc7a8dea90964bc | [
"MIT"
] | null | null | null | 10205/10205.py | Keilan/uva | 4218328466c3ab2fdf34cdf45fc7a8dea90964bc | [
"MIT"
] | null | null | null |
shuffle()
| 28.723077 | 99 | 0.547938 | import sys
class Card:
def __init__(self, rank, suit):
self.rank = rank
self.suit = suit
@classmethod
def from_position(cls, position):
"""
Given a number from 1 to 52, creates the card in the correct position assuming the deck
is sorted by alphabetical suits and t... | 0 | 483 | 0 | 183 | 0 | 1,130 | 0 | -11 | 68 |
803f3c5cd78d87ab3c97e23ccd0aab8fcc148c64 | 10,172 | py | Python | networking_f5_ml2/plugins/ml2/drivers/mech_f5/agent/f5_agent.py | sapcc/networking-f5-ml2 | 03739c1362df80510739afbdc937b5ec68591c52 | [
"Apache-2.0"
] | null | null | null | networking_f5_ml2/plugins/ml2/drivers/mech_f5/agent/f5_agent.py | sapcc/networking-f5-ml2 | 03739c1362df80510739afbdc937b5ec68591c52 | [
"Apache-2.0"
] | null | null | null | networking_f5_ml2/plugins/ml2/drivers/mech_f5/agent/f5_agent.py | sapcc/networking-f5-ml2 | 03739c1362df80510739afbdc937b5ec68591c52 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 SAP SE
#
# 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 appl... | 36.855072 | 122 | 0.608238 | # Copyright 2016 SAP SE
#
# 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 appl... | 0 | 0 | 0 | 8,615 | 0 | 0 | 0 | 255 | 423 |
1a75c8a8fd2beddcfde21f65f430272b0cbb7ae4 | 1,732 | py | Python | lstm.py | KT12/hands_on_machine_learning | 6de2292b43d7c34b6509ad61dab2da4f7ec04894 | [
"MIT"
] | null | null | null | lstm.py | KT12/hands_on_machine_learning | 6de2292b43d7c34b6509ad61dab2da4f7ec04894 | [
"MIT"
] | null | null | null | lstm.py | KT12/hands_on_machine_learning | 6de2292b43d7c34b6509ad61dab2da4f7ec04894 | [
"MIT"
] | null | null | null | import tensorflow as tf
tf.set_random_seed(5)
n_inputs = 28
n_neurons = 150
n_layers = 3
n_steps = 28
n_outputs = 10
learning_rate = 0.001
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/")
X_test = mnist.test.images.reshape((-1, n_steps, n_inputs))
y_test = m... | 33.960784 | 111 | 0.732102 | import tensorflow as tf
import numpy as np
tf.set_random_seed(5)
n_inputs = 28
n_neurons = 150
n_layers = 3
n_steps = 28
n_outputs = 10
learning_rate = 0.001
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/")
X_test = mnist.test.images.reshape((-1, n_steps, n_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
22230bd8b1f3797e8dc3f1afa43c1e2179290ce4 | 19,313 | py | Python | dygiepp/dygie/models/dygie.py | feiLinX/SciREX | 768c869af746f4a61b3d58b15897e03caa5e2d32 | [
"Apache-2.0"
] | 99 | 2020-05-04T11:07:00.000Z | 2022-03-30T12:55:00.000Z | dygiepp/dygie/models/dygie.py | feiLinX/SciREX | 768c869af746f4a61b3d58b15897e03caa5e2d32 | [
"Apache-2.0"
] | 13 | 2020-08-05T18:22:44.000Z | 2021-05-06T21:35:05.000Z | dygiepp/dygie/models/dygie.py | feiLinX/SciREX | 768c869af746f4a61b3d58b15897e03caa5e2d32 | [
"Apache-2.0"
] | 24 | 2020-07-09T13:37:42.000Z | 2022-03-26T09:56:43.000Z | import logging
# Import submodules.
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
| 47.68642 | 166 | 0.622741 | from os import path
import logging
from typing import Dict, List, Optional
import copy
import torch
import torch.nn.functional as F
from overrides import overrides
from allennlp.data import Vocabulary
from allennlp.common.params import Params
from allennlp.models.model import Model
from allennlp.modules import Seq2Se... | 0 | 18,429 | 0 | 0 | 0 | 0 | 0 | 377 | 399 |
665c07f5066184b2d353592c7cd71270f8ccbf8a | 4,245 | py | Python | utils.py | vdumoulin/espresso-shot | b8113b52e8468c659bd762f7d22243269bef3984 | [
"MIT"
] | null | null | null | utils.py | vdumoulin/espresso-shot | b8113b52e8468c659bd762f7d22243269bef3984 | [
"MIT"
] | null | null | null | utils.py | vdumoulin/espresso-shot | b8113b52e8468c659bd762f7d22243269bef3984 | [
"MIT"
] | null | null | null | """Utility functions."""
import json
import struct
import subprocess
# Measurements contain 5 floats (elapsed_time, basket_resistance,
# group_resistance, basket_temperature, and group_temperature) and an int
# (state, for which 0, 1, 2, and 3 map to START, RUNNING, STOP, and STOPPED,
# respectively).
FORMAT_STRING = ... | 30.106383 | 79 | 0.673027 | """Utility functions."""
import enum
import json
import struct
import subprocess
import time
import numpy as np
# Measurements contain 5 floats (elapsed_time, basket_resistance,
# group_resistance, basket_temperature, and group_temperature) and an int
# (state, for which 0, 1, 2, and 3 map to START, RUNNING, STOP, an... | 0 | 0 | 0 | 1,909 | 0 | 0 | 0 | -23 | 113 |
d63c354c403a2f8213840fefd6b381f385a4e15a | 239 | py | Python | setup.py | jangroth/gtit-cv | 6c912dcd11ced9f6613a36697a99eac86bf6480e | [
"MIT"
] | 2 | 2021-09-27T17:55:54.000Z | 2021-11-15T11:43:02.000Z | setup.py | jangroth/git-cv | 6c912dcd11ced9f6613a36697a99eac86bf6480e | [
"MIT"
] | null | null | null | setup.py | jangroth/git-cv | 6c912dcd11ced9f6613a36697a99eac86bf6480e | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="gitcv",
version="0.1",
packages=find_packages(),
author="Jan Groth",
license="MIT License",
setup_requires=['pytest-runner'],
tests_require=['pytest']
)
| 19.916667 | 43 | 0.661088 | from setuptools import setup, find_packages
setup(
name="gitcv",
version="0.1",
packages=find_packages(),
author="Jan Groth",
license="MIT License",
setup_requires=['pytest-runner'],
tests_require=['pytest']
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a573cae0a3b0113b03c43c3f97dc1f74f8754061 | 1,653 | py | Python | sine_attractors.py | dcxSt/attractors | 7df0fc593ca7bc2dbc05d488b1742fc359cf6c7f | [
"MIT"
] | 1 | 2021-11-07T11:56:53.000Z | 2021-11-07T11:56:53.000Z | sine_attractors.py | dcxSt/attractors | 7df0fc593ca7bc2dbc05d488b1742fc359cf6c7f | [
"MIT"
] | null | null | null | sine_attractors.py | dcxSt/attractors | 7df0fc593ca7bc2dbc05d488b1742fc359cf6c7f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# http://paulbourke.net/fractals/clifford/?curius=373
# In[13]:
import numpy as np
import matplotlib.pyplot as plt
# In[65]:
a = -1.5
b = 1.6
c = 1.2
d = 0.7
# In[66]:
# In[ ]:
# In[77]:
sidelength = 8192
center = (sidelength // 2 , sidelength // 2)
grid = np.z... | 17.967391 | 75 | 0.586812 | #!/usr/bin/env python
# coding: utf-8
# http://paulbourke.net/fractals/clifford/?curius=373
# In[13]:
import numpy as np
import math as m
import matplotlib.pyplot as plt
# In[65]:
a = -1.5
b = 1.6
c = 1.2
d = 0.7
# In[66]:
def update(x,y):
# takes floats, returns updated floats
xnew = m.sin(a * y) ... | 0 | 0 | 0 | 0 | 0 | 146 | 0 | -5 | 45 |
0f36567e3c2d414731c0ed12a4624896fc40e0c8 | 4,105 | py | Python | bot.py | MistyScene/AutoForms | e5391e95acfc1aaeae5bec635845203f7ff6b027 | [
"MIT"
] | null | null | null | bot.py | MistyScene/AutoForms | e5391e95acfc1aaeae5bec635845203f7ff6b027 | [
"MIT"
] | null | null | null | bot.py | MistyScene/AutoForms | e5391e95acfc1aaeae5bec635845203f7ff6b027 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import discord
import os
TOKEN = os.environ["TOKEN"]
client = discord.Client(intents=discord.Intents.all())
# 06:00-8:30
time_set = setting_time_set() #
tem_set = set_tem()
# Embed
loop.start()
client.run(TOKEN)
| 34.208333 | 120 | 0.625335 | # -*- coding: utf-8 -*-
import discord
from discord import Embed
from discord.ext import tasks
from datetime import datetime
import os
import requests
import random
import json
TOKEN = os.environ["TOKEN"]
client = discord.Client(intents=discord.Intents.all())
# 次回送信予定時刻を06:00-8:30までの間でランダムに設定
def sett... | 843 | 1,755 | 1,083 | 0 | 0 | 377 | 0 | -4 | 334 |
5609448a8b557b5dc9ac459a5689d4f1819a5e51 | 4,141 | py | Python | exam.py | mfshiu/dog-siamese | 3e9077f2231d9cc9ac8eea5ac246901d2d5e6729 | [
"MIT"
] | null | null | null | exam.py | mfshiu/dog-siamese | 3e9077f2231d9cc9ac8eea5ac246901d2d5e6729 | [
"MIT"
] | null | null | null | exam.py | mfshiu/dog-siamese | 3e9077f2231d9cc9ac8eea5ac246901d2d5e6729 | [
"MIT"
] | null | null | null | import os
import sys
import torch
from config import Config
from train3 import image_size
from model import SiameseNetwork
use_gpu = False
register_dir = "./data/ct0202a/"
threshold = 50
siam_model = None
log_lines = []
##
if __name__ == '__main__':
register_dir = Config.register_dir
dog_id = None
dog_i... | 31.853846 | 99 | 0.581744 | import os
import sys
import torch
from config import Config
from train3 import image_size
from model import SiameseNetwork
from evaluate3 import TestDataset
from torch.utils.data import DataLoader
use_gpu = False
register_dir = "./data/ct0202a/"
threshold = 50
siam_model = None
log_lines = []
##
def exam_dog(dog_id, ... | 12 | 0 | 0 | 0 | 0 | 1,523 | 0 | 30 | 90 |
e460f5ef73e060f6a64ca12aa77375e312b5b1cf | 3,974 | py | Python | auxiliary/auxiliary.py | burakbalaban/student-project-burakbalaban | 1b58ab1896e65937c16d9f5b4ff1a8bddc2d2db7 | [
"MIT"
] | null | null | null | auxiliary/auxiliary.py | burakbalaban/student-project-burakbalaban | 1b58ab1896e65937c16d9f5b4ff1a8bddc2d2db7 | [
"MIT"
] | null | null | null | auxiliary/auxiliary.py | burakbalaban/student-project-burakbalaban | 1b58ab1896e65937c16d9f5b4ff1a8bddc2d2db7 | [
"MIT"
] | null | null | null | """This module contains auxiliary function which we use in the example notebook."""
import json
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
from scipy.stats import norm
import pandas as pd
import numpy as np
from grmpy.estimate.estimate_output import calculate_mte
from grmpy.read.read import... | 36.458716 | 92 | 0.657776 | """This module contains auxiliary function which we use in the example notebook."""
import json
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
from scipy.stats import norm
import pandas as pd
import numpy as np
from grmpy.estimate.estimate_output import calculate_mte
from grmpy.read.read import... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
375be2219b434f699514d5dfd0f487eacc8beb7f | 8,132 | py | Python | dataentry/models.py | louisdijkstra/kumbhmela-metadata | 59c6f22d0d5b307617ff03e3700c089f209788bf | [
"MIT"
] | null | null | null | dataentry/models.py | louisdijkstra/kumbhmela-metadata | 59c6f22d0d5b307617ff03e3700c089f209788bf | [
"MIT"
] | null | null | null | dataentry/models.py | louisdijkstra/kumbhmela-metadata | 59c6f22d0d5b307617ff03e3700c089f209788bf | [
"MIT"
] | null | null | null |
"""
Contains the models/tables for the kumbhmela_db.sqlite3
database.
Every field has (when necessary) a 'help_text' that
explains the meaning of the field.
"""
__author__ = "Louis Dijkstra"
| 33.883333 | 107 | 0.688269 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
"""
Contains the models/tables for the kumbhmela_db.sqlite3
database.
Every field has (when necessary) a 'help_text' that
explains the meaning of the field.
"""
__author__ = "Louis Dijkstra"
@python_2_unicode_compatib... | 0 | 7,107 | 0 | 496 | 0 | 0 | 0 | 47 | 277 |
7cbb4eae4e6ffdbfc230e0a6bca2576aecfb51ea | 8,954 | py | Python | generalexam/plotting/front_plotting.py | thunderhoser/GeneralExam | 95b99a16fdaa67dae69586c7f7c76e27ccd4b89a | [
"MIT"
] | 4 | 2019-05-10T11:03:48.000Z | 2020-10-19T08:04:09.000Z | generalexam/plotting/front_plotting.py | thunderhoser/GeneralExam | 95b99a16fdaa67dae69586c7f7c76e27ccd4b89a | [
"MIT"
] | null | null | null | generalexam/plotting/front_plotting.py | thunderhoser/GeneralExam | 95b99a16fdaa67dae69586c7f7c76e27ccd4b89a | [
"MIT"
] | 3 | 2020-11-19T08:16:31.000Z | 2021-03-04T02:30:15.000Z | """Plotting methods for warm and cold fronts."""
import numpy
import matplotlib
matplotlib.use('agg')
import matplotlib.colors
from gewittergefahr.gg_utils import longitude_conversion as lng_conversion
from gewittergefahr.gg_utils import error_checking
from generalexam.ge_utils import front_utils
from generalexam.plot... | 42.436019 | 80 | 0.742573 | """Plotting methods for warm and cold fronts."""
import numpy
import matplotlib
matplotlib.use('agg')
import matplotlib.colors
from gewittergefahr.gg_utils import longitude_conversion as lng_conversion
from gewittergefahr.gg_utils import error_checking
from generalexam.ge_utils import front_utils
from generalexam.plot... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8688bd25c08e7e8ca794f9c3a84a55b513d0107f | 20,875 | py | Python | propara/evaluation/evalQA.py | keisks/propara | 49fa8fe0481291df18b2c7b48e7ba1dafaad48e2 | [
"Apache-2.0"
] | 84 | 2018-06-02T02:00:53.000Z | 2022-03-13T12:17:42.000Z | propara/evaluation/evalQA.py | keisks/propara | 49fa8fe0481291df18b2c7b48e7ba1dafaad48e2 | [
"Apache-2.0"
] | 3 | 2018-10-31T00:28:31.000Z | 2020-05-12T01:06:53.000Z | propara/evaluation/evalQA.py | keisks/propara | 49fa8fe0481291df18b2c7b48e7ba1dafaad48e2 | [
"Apache-2.0"
] | 13 | 2018-09-14T20:37:51.000Z | 2021-03-23T09:24:49.000Z | import collections
#--------------------------------------------------------------
# Author: Scott Wen-tau Yih
# Usage: evalQA.py para-ids gold-labels system-predictions
# example usage: python propara/eval/evalQA.py tests/fixtures/eval/para_id.test.txt tests/fixtures/eval/gold_labels.test.tsv tests/fixtures/eval/samp... | 42.689162 | 179 | 0.57988 | import sys, collections, pylev
from stemming.porter2 import stem
#--------------------------------------------------------------
# Author: Scott Wen-tau Yih
# Usage: evalQA.py para-ids gold-labels system-predictions
# example usage: python propara/eval/evalQA.py tests/fixtures/eval/para_id.test.txt tests/fixtures/eval... | 0 | 0 | 0 | 0 | 0 | 16,649 | 0 | 24 | 563 |
deae37deb80e55431aeffc4a40f5e13cb6af2f86 | 2,360 | py | Python | peerlyApp/peerlyWS.py | z4m0/peerly | 187275822dcb6f35cc798c277ec43287e778a049 | [
"MIT"
] | null | null | null | peerlyApp/peerlyWS.py | z4m0/peerly | 187275822dcb6f35cc798c277ec43287e778a049 | [
"MIT"
] | null | null | null | peerlyApp/peerlyWS.py | z4m0/peerly | 187275822dcb6f35cc798c277ec43287e778a049 | [
"MIT"
] | null | null | null | from gevent import monkey; monkey.patch_all()
from twisted.python import log
import sys
log.startLogging(sys.stdout)
| 27.764706 | 71 | 0.587288 | from gevent import monkey; monkey.patch_all()
import gevent
from socketio import socketio_manage
from socketio.server import SocketIOServer
from socketio.namespace import BaseNamespace
from socketio.mixins import RoomsMixin, BroadcastMixin
from twisted.internet import reactor, task, defer
from twisted.python import ... | 0 | 0 | 0 | 1,777 | 0 | 83 | 0 | 141 | 226 |
9134aff78215faf06e32eb3662c9a17d4dfcc14c | 13,671 | py | Python | ppr-api/src/ppr_api/resources/searches.py | cameron-freshworks/ppr | 01d6f5d300c791aebad5e58bb4601e9be2ccfc46 | [
"Apache-2.0"
] | null | null | null | ppr-api/src/ppr_api/resources/searches.py | cameron-freshworks/ppr | 01d6f5d300c791aebad5e58bb4601e9be2ccfc46 | [
"Apache-2.0"
] | null | null | null | ppr-api/src/ppr_api/resources/searches.py | cameron-freshworks/ppr | 01d6f5d300c791aebad5e58bb4601e9be2ccfc46 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Province of British Columbia
#
# 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... | 47.634146 | 116 | 0.684661 | # Copyright © 2019 Province of British Columbia
#
# 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 agr... | 2 | 6,585 | 0 | 0 | 0 | 0 | 0 | 239 | 135 |
a7efbeae0499e8157828f5c76354ddc9e5702563 | 71 | py | Python | airbyte-integrations/connectors/source-smartsheets/source_smartsheets/__init__.py | rajatariya21/airbyte | 11e70a7a96e2682b479afbe6f709b9a5fe9c4a8d | [
"MIT"
] | 6,215 | 2020-09-21T13:45:56.000Z | 2022-03-31T21:21:45.000Z | airbyte-integrations/connectors/source-smartsheets/source_smartsheets/__init__.py | rajatariya21/airbyte | 11e70a7a96e2682b479afbe6f709b9a5fe9c4a8d | [
"MIT"
] | 8,448 | 2020-09-21T00:43:50.000Z | 2022-03-31T23:56:06.000Z | airbyte-integrations/connectors/source-smartsheets/source_smartsheets/__init__.py | rajatariya21/airbyte | 11e70a7a96e2682b479afbe6f709b9a5fe9c4a8d | [
"MIT"
] | 1,251 | 2020-09-20T05:48:47.000Z | 2022-03-31T10:41:29.000Z | from .source import SourceSmartsheets
__all__ = ["SourceSmartsheets"]
| 17.75 | 37 | 0.802817 | from .source import SourceSmartsheets
__all__ = ["SourceSmartsheets"]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
abcc03631da5d5f6c8a14d3e8de962d1222734b2 | 123 | py | Python | backend/todoList/admin.py | crowdbotics-apps/basic-todo-app-28878 | c84718ed616ec508eeb948caa78413f964f560b6 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/todoList/admin.py | crowdbotics-apps/basic-todo-app-28878 | c84718ed616ec508eeb948caa78413f964f560b6 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/todoList/admin.py | crowdbotics-apps/basic-todo-app-28878 | c84718ed616ec508eeb948caa78413f964f560b6 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.contrib import admin
from .models import ToDoItem
admin.site.register(ToDoItem)
# Register your models here.
| 17.571429 | 32 | 0.804878 | from django.contrib import admin
from .models import ToDoItem
admin.site.register(ToDoItem)
# Register your models here.
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b39943285433efe684d03e8d444f09fad241a11d | 439 | py | Python | bitirmetezi/venv/Lib/site-packages/where/__main__.py | busraltun/IMPLEMENTATIONOFEYECONTROLLEDVIRTUALKEYBOARD | fa3a9b150419a17aa82f41b068a5d69d0ff0d0f3 | [
"MIT"
] | null | null | null | bitirmetezi/venv/Lib/site-packages/where/__main__.py | busraltun/IMPLEMENTATIONOFEYECONTROLLEDVIRTUALKEYBOARD | fa3a9b150419a17aa82f41b068a5d69d0ff0d0f3 | [
"MIT"
] | null | null | null | bitirmetezi/venv/Lib/site-packages/where/__main__.py | busraltun/IMPLEMENTATIONOFEYECONTROLLEDVIRTUALKEYBOARD | fa3a9b150419a17aa82f41b068a5d69d0ff0d0f3 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import sys
if __name__ == "__main__":
sys.exit(main())
| 19.086957 | 110 | 0.708428 | from __future__ import absolute_import
import sys
import argparse
import where
def main():
parser = argparse.ArgumentParser( description="Find the locations of a file in the environment's paths." )
parser.add_argument("filename", type=str, help="The filename to be found")
args = parser.parse_args()
... | 0 | 0 | 0 | 0 | 0 | 283 | 0 | -15 | 68 |
9c840b83d5f099c8dd509d91b19bea7595c02e13 | 907 | py | Python | rulesets/apps/class-b/on-location-change-notifier-slack/__deploy__.py | airspot-dev/iot-demo | 5f8c1877192043f4118b102ad1f71326d40de858 | [
"Apache-2.0"
] | 1 | 2021-06-22T10:26:54.000Z | 2021-06-22T10:26:54.000Z | rulesets/apps/class-b/on-location-change-notifier-slack/__deploy__.py | airspot-dev/iot-demo | 5f8c1877192043f4118b102ad1f71326d40de858 | [
"Apache-2.0"
] | null | null | null | rulesets/apps/class-b/on-location-change-notifier-slack/__deploy__.py | airspot-dev/iot-demo | 5f8c1877192043f4118b102ad1f71326d40de858 | [
"Apache-2.0"
] | 1 | 2021-09-20T11:56:50.000Z | 2021-09-20T11:56:50.000Z |
name = "on-location-change-notifier-slack"
add_files = (
"ruleset.py",
)
add_modules = True # find modules in directory (folders having __init__.py file) and add them to container
extra_commands = (
# ("RUN", "pip install my-wonderful-lib==1.0"),
)
labels = {
"networking.knative.dev/visibility": "clust... | 21.093023 | 107 | 0.627343 |
name = "on-location-change-notifier-slack"
add_files = (
"ruleset.py",
)
add_modules = True # find modules in directory (folders having __init__.py file) and add them to container
extra_commands = (
# ("RUN", "pip install my-wonderful-lib==1.0"),
)
labels = {
"networking.knative.dev/visibility": "clust... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2dbb7cad82088c634a4e4ad958527162927d1e63 | 4,171 | py | Python | qmpy/analysis/debye/sound_waves.py | JosephMontoya-TRI/qmpy | 5a5aa7b25b1231801969ea042bbd2309cacc7859 | [
"MIT"
] | 1 | 2019-11-15T20:54:04.000Z | 2019-11-15T20:54:04.000Z | qmpy/analysis/debye/sound_waves.py | JosephMontoya-TRI/qmpy_py3 | 5a5aa7b25b1231801969ea042bbd2309cacc7859 | [
"MIT"
] | null | null | null | qmpy/analysis/debye/sound_waves.py | JosephMontoya-TRI/qmpy_py3 | 5a5aa7b25b1231801969ea042bbd2309cacc7859 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# sound_waves.py v1.1 12-3-2011 Jeff Doak jeff.w.doak@gmail.com
import sys
import scipy as sp
from scipy import linalg
from scipy.integrate import dblquad
BOLTZCONST = 1.381e-23 # J/K
PLANCKCONST = 6.626e-34 # J*s
AVONUM = 6.022e23 # things/mol
def dir_cosines(dir,coords=sp.identity(3)):
""... | 33.368 | 83 | 0.587389 | #!/usr/bin/python
# sound_waves.py v1.1 12-3-2011 Jeff Doak jeff.w.doak@gmail.com
import sys
import scipy as sp
from scipy import linalg
from scipy.integrate import dblquad
import read_file
BOLTZCONST = 1.381e-23 # J/K
PLANCKCONST = 6.626e-34 # J*s
AVONUM = 6.022e23 # things/mol
def dir_cosines(dir,coords=sp.ide... | 0 | 0 | 0 | 0 | 0 | 1,089 | 0 | -5 | 71 |
c5b7670fef4ed19a20f598574ac6006d29d5300e | 6,275 | py | Python | bokeh/core/json_encoder.py | teresafds/bokeh | 95b2a74ff463cfabdf9e3390951fa380166e6691 | [
"BSD-3-Clause"
] | null | null | null | bokeh/core/json_encoder.py | teresafds/bokeh | 95b2a74ff463cfabdf9e3390951fa380166e6691 | [
"BSD-3-Clause"
] | null | null | null | bokeh/core/json_encoder.py | teresafds/bokeh | 95b2a74ff463cfabdf9e3390951fa380166e6691 | [
"BSD-3-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 35.055866 | 112 | 0.530837 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 0 | 0 | 0 | 666 | 0 | 0 | 0 | 14 | 45 |
42858455a9d8d1c85110f33472d486a90e93cd08 | 129 | py | Python | answers/Utkarsh Srivastava/Day 11/Question 2.py | arc03/30-DaysOfCode-March-2021 | 6d6e11bf70280a578113f163352fa4fa8408baf6 | [
"MIT"
] | 22 | 2021-03-16T14:07:47.000Z | 2021-08-13T08:52:50.000Z | answers/Utkarsh Srivastava/Day 11/Question 2.py | arc03/30-DaysOfCode-March-2021 | 6d6e11bf70280a578113f163352fa4fa8408baf6 | [
"MIT"
] | 174 | 2021-03-16T21:16:40.000Z | 2021-06-12T05:19:51.000Z | answers/Utkarsh Srivastava/Day 11/Question 2.py | arc03/30-DaysOfCode-March-2021 | 6d6e11bf70280a578113f163352fa4fa8408baf6 | [
"MIT"
] | 135 | 2021-03-16T16:47:12.000Z | 2021-06-27T14:22:38.000Z | s = input()
c = 0
n = int(input())
a = [0]*3
c = 0
for i in range(n):
a[i] = input()
for i in (a):
print(s.count(i))
| 12.9 | 25 | 0.465116 | s = input()
c = 0
n = int(input())
a = [0]*3
c = 0
for i in range(n):
a[i] = input()
for i in (a):
print(s.count(i))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
894d4c7667d1425ee76f58054c9c118df88cf99b | 3,334 | py | Python | bag_serdes_ec-master/BagModules/bag_serdes_ec/sense_amp_strongarm.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | null | null | null | bag_serdes_ec-master/BagModules/bag_serdes_ec/sense_amp_strongarm.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | null | null | null | bag_serdes_ec-master/BagModules/bag_serdes_ec/sense_amp_strongarm.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | 1 | 2020-01-07T04:53:53.000Z | 2020-01-07T04:53:53.000Z | # -*- coding: utf-8 -*-
import os
import pkg_resources
yaml_file = pkg_resources.resource_filename(__name__, os.path.join('netlist_info',
'sense_amp_strongarm.yaml'))
# noinspection PyPep8Naming
| 37.460674 | 95 | 0.520996 | # -*- coding: utf-8 -*-
from typing import Dict, Any
import os
import pkg_resources
from bag.design import Module
yaml_file = pkg_resources.resource_filename(__name__, os.path.join('netlist_info',
'sense_amp_strongarm.yaml'))
# noinspection PyPep... | 0 | 545 | 0 | 2,439 | 0 | 0 | 0 | 15 | 68 |
771589f652cba1494d3ee1702e46549bfb1750de | 261 | py | Python | example/parse_space_to_tab.py | pflans/edge | d84de02bd9b334212b7405ecc4e68d3a209add99 | [
"MIT"
] | 32 | 2017-05-15T06:03:46.000Z | 2022-02-18T08:30:19.000Z | example/parse_space_to_tab.py | pflans/edge | d84de02bd9b334212b7405ecc4e68d3a209add99 | [
"MIT"
] | 36 | 2017-05-11T01:29:14.000Z | 2022-02-10T07:31:24.000Z | example/parse_space_to_tab.py | pflans/edge | d84de02bd9b334212b7405ecc4e68d3a209add99 | [
"MIT"
] | 4 | 2017-09-19T18:10:45.000Z | 2019-11-29T03:38:08.000Z | # flake8: noqa
# Converting GFF format with space in lines starting with gi to tab
import sys
import re
fn = sys.argv[1]
f = open(fn, "r")
for l in f.read().split("\n"):
if l.startswith("gi"):
print re.sub(" ", "\t", l)
else:
print l
| 17.4 | 67 | 0.586207 | # flake8: noqa
# Converting GFF format with space in lines starting with gi to tab
import sys
import re
fn = sys.argv[1]
f = open(fn, "r")
for l in f.read().split("\n"):
if l.startswith("gi"):
print re.sub(" ", "\t", l)
else:
print l
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
674346ea0686745d41b14badeff5ce6bb87c69bf | 4,514 | py | Python | sat_solver.py | mrolinek/alpha_skat | d045d5680829d9b70f710608d1a0dff2a43a89a2 | [
"MIT"
] | null | null | null | sat_solver.py | mrolinek/alpha_skat | d045d5680829d9b70f710608d1a0dff2a43a89a2 | [
"MIT"
] | null | null | null | sat_solver.py | mrolinek/alpha_skat | d045d5680829d9b70f710608d1a0dff2a43a89a2 | [
"MIT"
] | null | null | null |
# from numba import njit, int16
# @njit(int16[:,:](int16[:]))
| 37 | 100 | 0.696721 | import random
from itertools import islice
from pysat.solvers import Minicard
import numpy as np
# from numba import njit, int16
from utils import np_one_hot, softmax
def add_equal(solver, literals, k):
solver.add_atmost(literals, k=k)
solver.add_atmost([-lit for lit in literals], k=len(literals) - k)
def... | 0 | 0 | 0 | 0 | 0 | 4,195 | 0 | 25 | 225 |
da76f995d11bd28ae523a0312bda5e882e405910 | 18 | py | Python | vapetool/__init__.py | vape-tool/VapeTool-BatteriesParser | 54281efd489152367d1270b385c5dbef355bb4f3 | [
"MIT"
] | null | null | null | vapetool/__init__.py | vape-tool/VapeTool-BatteriesParser | 54281efd489152367d1270b385c5dbef355bb4f3 | [
"MIT"
] | null | null | null | vapetool/__init__.py | vape-tool/VapeTool-BatteriesParser | 54281efd489152367d1270b385c5dbef355bb4f3 | [
"MIT"
] | null | null | null | name = "vapetool"
| 9 | 17 | 0.666667 | name = "vapetool"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d79c076c8011693447d6fb2aef7d47c679a26d5d | 95 | py | Python | pdd_sdk/api/__init__.py | ymj4023/pdd_sdk | a8ab114542e5f450b7ea32fb3c0564dfbb2f4e36 | [
"MIT"
] | 1 | 2020-07-07T06:47:15.000Z | 2020-07-07T06:47:15.000Z | pdd_sdk/api/__init__.py | ymj4023/pdd_sdk | a8ab114542e5f450b7ea32fb3c0564dfbb2f4e36 | [
"MIT"
] | null | null | null | pdd_sdk/api/__init__.py | ymj4023/pdd_sdk | a8ab114542e5f450b7ea32fb3c0564dfbb2f4e36 | [
"MIT"
] | null | null | null |
"""
__init__.py.py:
""" | 11.875 | 37 | 0.715789 |
"""
__init__.py.py:
"""
from pdd_sdk.api.rest import *
from pdd_sdk.api.base import FileItem | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 45 |
55c34f1cedaab14c52d32e5d7def43998f4cfbac | 51,214 | py | Python | robot/EDA/resources/locators_54.py | eclemmer/EDA | 3a6d2b86acfdca47c450a34ba9bd7a73cd299b62 | [
"BSD-3-Clause"
] | null | null | null | robot/EDA/resources/locators_54.py | eclemmer/EDA | 3a6d2b86acfdca47c450a34ba9bd7a73cd299b62 | [
"BSD-3-Clause"
] | null | null | null | robot/EDA/resources/locators_54.py | eclemmer/EDA | 3a6d2b86acfdca47c450a34ba9bd7a73cd299b62 | [
"BSD-3-Clause"
] | 1 | 2022-02-25T18:23:49.000Z | 2022-02-25T18:23:49.000Z | """ Locators for Spring '22 """
eda_lex_locators = {
"app_tile": "//one-app-launcher-modal//one-app-launcher-app-tile//a[.='{}']",
"app_item": "//a[@data-label='{}']",
"frame": "//iframe[contains(@id, '{}') or contains(@title, '{}') or contains(@name, '{}')]",
"input_placeholder": "//input[contains(@pl... | 123.407229 | 692 | 0.674484 | """ Locators for Spring '22 """
eda_lex_locators = {
"app_tile": "//one-app-launcher-modal//one-app-launcher-app-tile//a[.='{}']",
"app_item": "//a[@data-label='{}']",
"frame": "//iframe[contains(@id, '{}') or contains(@title, '{}') or contains(@name, '{}')]",
"input_placeholder": "//input[contains(@pl... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6f6d746b9a3ce48ddba1228adbb0c0e61ec61582 | 876 | py | Python | keylogger.py | SailikhithGunda/Keylogger | 007e57a15cdcf07303a7082c2cdbe3e043ccc481 | [
"MIT"
] | null | null | null | keylogger.py | SailikhithGunda/Keylogger | 007e57a15cdcf07303a7082c2cdbe3e043ccc481 | [
"MIT"
] | null | null | null | keylogger.py | SailikhithGunda/Keylogger | 007e57a15cdcf07303a7082c2cdbe3e043ccc481 | [
"MIT"
] | null | null | null |
'''
Things to do:
An exe / chrome extension
automatically run the script
Automatically export the text file to a server/client.
'''
from pynput.keyboard import Listener
count = 0
keys = []
with Listener(on_press = on_press, on_release = on_release) as listener:
listener.join()
| 19.909091 | 73 | 0.509132 |
'''
Things to do:
An exe / chrome extension
automatically run the script
Automatically export the text file to a server/client.
'''
from pynput.keyboard import Key, Listener
count = 0
keys = []
def on_press(key):
global keys, count
keys.append(key)
count += 1
if coun... | 0 | 0 | 0 | 0 | 0 | 477 | 0 | 5 | 74 |
1981ec4ebe0a96c972dacd81ff0a61b27a12c7ff | 1,707 | py | Python | Lists.py | tourloukisg/Python_Tutorial | a5a05e38aa88a0d3878fd6530f9952002755e0ae | [
"MIT"
] | null | null | null | Lists.py | tourloukisg/Python_Tutorial | a5a05e38aa88a0d3878fd6530f9952002755e0ae | [
"MIT"
] | null | null | null | Lists.py | tourloukisg/Python_Tutorial | a5a05e38aa88a0d3878fd6530f9952002755e0ae | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 6 21:10:57 2021
@author: geoto
"""
#clear list
item=mylist3.clear()
print(item)
print('-----------------------------------------------')
#reverse list
print(mylist)
list_rev=mylist.reverse()#reverse() used inplace=True so the change takes ... | 19.848837 | 101 | 0.663152 | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 6 21:10:57 2021
@author: geoto
"""
#clear list
item=mylist3.clear()
print(item)
print('-----------------------------------------------')
#reverse list
print(mylist)
list_rev=mylist.reverse()#reverse() used inplace=True so the change takes ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1cad44a594c7e9036bfadb91940e424ec03efd2b | 5,209 | py | Python | bihar/bihar_backtest.py | COVID-IWG/epimargin-studies | 7d4a78e2e6713c6a0aea2cd2440529153e9a635d | [
"MIT"
] | null | null | null | bihar/bihar_backtest.py | COVID-IWG/epimargin-studies | 7d4a78e2e6713c6a0aea2cd2440529153e9a635d | [
"MIT"
] | null | null | null | bihar/bihar_backtest.py | COVID-IWG/epimargin-studies | 7d4a78e2e6713c6a0aea2cd2440529153e9a635d | [
"MIT"
] | null | null | null | from warnings import simplefilter
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import etl
from epimargin.estimators import analytical_MPVS
from epimargin.etl.commons import download_data
from epimargin.etl.covid19india import data_path, get_time_series, load_all_data
from epimargin.model imp... | 42.349593 | 300 | 0.730275 | from pathlib import Path
from typing import Dict, Optional, Sequence, Tuple
from warnings import simplefilter
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from statsmodels.regression.linear_model import OLS
from statsmodels.tools import add_constant
from tqdm import tqdm
import etl
from epim... | 0 | 0 | 0 | 0 | 0 | 267 | 0 | 89 | 133 |
bc77493303e5ad9f2e8d68e8426387e82ce4266d | 1,136 | py | Python | tests/get_test_name_and_number.py | steverpalmer/GenericTesting | 89dd9a7bf6bed74b009a0cdeaeef445993608162 | [
"BSD-3-Clause"
] | null | null | null | tests/get_test_name_and_number.py | steverpalmer/GenericTesting | 89dd9a7bf6bed74b009a0cdeaeef445993608162 | [
"BSD-3-Clause"
] | null | null | null | tests/get_test_name_and_number.py | steverpalmer/GenericTesting | 89dd9a7bf6bed74b009a0cdeaeef445993608162 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2021 Steve Palmer
"""Generate a complete list of test numbers and names."""
import collections
TestRecord = collections.namedtuple("TestRecord", ["class_", "testname", "test_number"])
if __name__ == "__main__":
Main()
| 32.457143 | 111 | 0.582746 | #!/usr/bin/env python3
# Copyright 2021 Steve Palmer
"""Generate a complete list of test numbers and names."""
import collections
import inspect
import generic_testing
TestRecord = collections.namedtuple("TestRecord", ["class_", "testname", "test_number"])
class Main:
def __init__(self):
alltests = []... | 0 | 0 | 0 | 811 | 0 | 0 | 0 | -6 | 68 |
9c0d04b816acc96817c632107ea912ad5acdddcd | 4,708 | py | Python | sdks/python/apache_beam/examples/cookbook/group_with_coder.py | szewi/beam | ae0de1bb5f44ab39969442932c662ecde668bce3 | [
"Apache-2.0"
] | 4 | 2020-10-09T01:46:55.000Z | 2020-10-09T02:12:19.000Z | python/dataflow_examples/cookbook/group_with_coder.py | yufengzh/DataflowSDK-examples | 3727e986e5835286d5bdf5bc679af5e0be090097 | [
"Apache-2.0"
] | 12 | 2019-11-13T04:59:52.000Z | 2021-12-14T21:13:47.000Z | python/dataflow_examples/cookbook/group_with_coder.py | yufengzh/DataflowSDK-examples | 3727e986e5835286d5bdf5bc679af5e0be090097 | [
"Apache-2.0"
] | 2 | 2017-09-23T14:41:17.000Z | 2018-08-29T02:57:03.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 37.967742 | 80 | 0.731308 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 0 | 127 | 0 | 787 | 0 | 0 | 0 | 0 | 68 |
38cf8917ebc220ff8754786994efb4af03ae9a65 | 644 | py | Python | forum/threads/migrations/0011_thread_followers.py | successIA/Forum | 08de91a033da2c3779acbf95dfe0210eb1276a26 | [
"MIT"
] | null | null | null | forum/threads/migrations/0011_thread_followers.py | successIA/Forum | 08de91a033da2c3779acbf95dfe0210eb1276a26 | [
"MIT"
] | 6 | 2020-08-13T18:54:33.000Z | 2021-06-10T20:20:16.000Z | forum/threads/migrations/0011_thread_followers.py | successIA/ClassicForum | 08de91a033da2c3779acbf95dfe0210eb1276a26 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-11-21 23:29
from __future__ import unicode_literals
| 28 | 141 | 0.68323 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-11-21 23:29
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 0 | 0 | 0 | 431 | 0 | 0 | 0 | 30 | 68 |
1cb01409585916ebaaa745f459bc65177a6e04ff | 44,690 | py | Python | src/config/svc-monitor/svc_monitor/tests/test_f5_lb.py | UbuntuEvangelist/contrail-controller | 4e8a992230f8f8e91e4f753e19b5442d9e1b446d | [
"Apache-2.0"
] | null | null | null | src/config/svc-monitor/svc_monitor/tests/test_f5_lb.py | UbuntuEvangelist/contrail-controller | 4e8a992230f8f8e91e4f753e19b5442d9e1b446d | [
"Apache-2.0"
] | null | null | null | src/config/svc-monitor/svc_monitor/tests/test_f5_lb.py | UbuntuEvangelist/contrail-controller | 4e8a992230f8f8e91e4f753e19b5442d9e1b446d | [
"Apache-2.0"
] | 18 | 2017-01-12T09:28:44.000Z | 2019-04-18T20:47:42.000Z | #end F5LBTest(unittest.TestCase):
| 47.643923 | 318 | 0.637055 | import mock
from mock import patch
import unittest
from cfgm_common.vnc_db import DBBase
from svc_monitor import config_db
from svc_monitor import loadbalancer_agent
from vnc_api.vnc_api import *
import argparse
import ConfigParser
class F5LBTest(unittest.TestCase):
def setUp(self):
self.vnc_lib = mock.Moc... | 0 | 0 | 0 | 44,401 | 0 | 0 | 0 | 34 | 221 |
c50ba6b8e1ade4d4df84686b6b1fc92c6b818a1b | 2,307 | py | Python | vendor-local/src/python-nose/scripts/mkindex.py | mozilla/sheriffs | 9e3a837e0115252e01c9bcd5c9d56d11af760875 | [
"BSD-3-Clause"
] | null | null | null | vendor-local/src/python-nose/scripts/mkindex.py | mozilla/sheriffs | 9e3a837e0115252e01c9bcd5c9d56d11af760875 | [
"BSD-3-Clause"
] | null | null | null | vendor-local/src/python-nose/scripts/mkindex.py | mozilla/sheriffs | 9e3a837e0115252e01c9bcd5c9d56d11af760875 | [
"BSD-3-Clause"
] | 1 | 2019-11-02T23:29:13.000Z | 2019-11-02T23:29:13.000Z | #!/usr/bin/env python
from docutils.core import publish_string, publish_parts
from docutils.readers.standalone import Reader
from nose.config import Config
from nose.plugins.manager import BuiltinPluginManager
import nose
import nose.commands
import nose.tools
import os
import re
import time
doc_word.priority = 100
... | 28.8375 | 77 | 0.674902 | #!/usr/bin/env python
from docutils.core import publish_string, publish_parts
from docutils.readers.standalone import Reader
from nose.config import Config
from nose.plugins.manager import BuiltinPluginManager
import nose
import nose.commands
import nose.tools
import os
import re
import time
def doc_word(node):
p... | 0 | 0 | 0 | 49 | 0 | 231 | 0 | 0 | 46 |
270ee543b329ffc1200cf23a84edbb417e93fe3f | 722 | py | Python | biserici_inlemnite/app/migrations/0012_descrierepage_gabarit_exterior_al_talpilor.py | ck-tm/biserici-inlemnite | c9d12127b92f25d3ab2fcc7b4c386419fe308a4e | [
"MIT"
] | null | null | null | biserici_inlemnite/app/migrations/0012_descrierepage_gabarit_exterior_al_talpilor.py | ck-tm/biserici-inlemnite | c9d12127b92f25d3ab2fcc7b4c386419fe308a4e | [
"MIT"
] | null | null | null | biserici_inlemnite/app/migrations/0012_descrierepage_gabarit_exterior_al_talpilor.py | ck-tm/biserici-inlemnite | c9d12127b92f25d3ab2fcc7b4c386419fe308a4e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.13 on 2021-09-21 15:33
| 34.380952 | 240 | 0.695291 | # Generated by Django 3.1.13 on 2021-09-21 15:33
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0023_add_choose_permissions'),
('app', '0011_remove_descrierepage_gabarit_exterior_al_talpilor'),
... | 10 | 0 | 0 | 569 | 0 | 0 | 0 | 30 | 68 |
4e2e7c10c7e9a5d0b6ea8f2706b2f2759257445a | 2,047 | py | Python | examples/collectibles_simple.py | TheoLvs/westworld | 7fb435f3a028ff3d3156bf2a023b44ee06aa9f8b | [
"MIT"
] | null | null | null | examples/collectibles_simple.py | TheoLvs/westworld | 7fb435f3a028ff3d3156bf2a023b44ee06aa9f8b | [
"MIT"
] | 3 | 2021-09-06T23:12:23.000Z | 2021-09-17T01:04:34.000Z | examples/collectibles_simple.py | TheoLvs/westworld | 7fb435f3a028ff3d3156bf2a023b44ee06aa9f8b | [
"MIT"
] | null | null | null | """Simulation where an agent will get all collectibles spawn randomly
"""
import sys
sys.path.append("../")
from westworld.environment import GridEnvironment
from westworld.simulation import Simulation
#==================================================================================================
# BASE CLAS... | 26.934211 | 99 | 0.50171 | """Simulation where an agent will get all collectibles spawn randomly
"""
import sys
sys.path.append("../")
from westworld.environment import GridEnvironment
from westworld.agents import BaseGridAgent
from westworld.objects import BaseObstacle,BaseTrigger,BaseCollectible
from westworld.simulation import Simulation
... | 0 | 0 | 0 | 749 | 0 | 0 | 0 | 79 | 120 |
91da93d1a3454065294d6224dce2fef0ad33aa04 | 1,053 | py | Python | gmit--exercise04--problem02--fibonacci-even-values-under-4million--code--20180224.py | g00364787/52167assessments | 65318102196fbbf40b764cd189edc4e31963ecf5 | [
"Apache-2.0"
] | null | null | null | gmit--exercise04--problem02--fibonacci-even-values-under-4million--code--20180224.py | g00364787/52167assessments | 65318102196fbbf40b764cd189edc4e31963ecf5 | [
"Apache-2.0"
] | null | null | null | gmit--exercise04--problem02--fibonacci-even-values-under-4million--code--20180224.py | g00364787/52167assessments | 65318102196fbbf40b764cd189edc4e31963ecf5 | [
"Apache-2.0"
] | null | null | null | # AUTHOR = PAUL KEARNEY
# STUDENT ID = G00364787
# DATE = 2018-02-24
#
# STUDENT ID = G00364787
# EXERCISE 04
# projectEuler problem 2
# references used
# http://www.tutorialspoint.com/python/python_basic_operators.htm
# https://www.tutorialspoint.com/python/python_strings.htm
# https://stackoverflow.co... | 21.06 | 73 | 0.595442 | # AUTHOR = PAUL KEARNEY
# STUDENT ID = G00364787
# DATE = 2018-02-24
#
# STUDENT ID = G00364787
# EXERCISE 04
# projectEuler problem 2
# references used
# http://www.tutorialspoint.com/python/python_basic_operators.htm
# https://www.tutorialspoint.com/python/python_strings.htm
# https://stackoverflow.co... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
16c23eeac2b96f412b198365c9cccb8c69ca1254 | 2,567 | py | Python | tutorials/W3D4_DeepLearning1/solutions/W3D4_Tutorial3_Solution_fba5d745.py | liuxiaomiao123/NeuroMathAcademy | 16a7969604a300bf9fbb86f8a5b26050ebd14c65 | [
"CC-BY-4.0"
] | 2 | 2020-07-03T04:39:09.000Z | 2020-07-12T02:08:31.000Z | tutorials/W3D4_DeepLearning1/solutions/W3D4_Tutorial3_Solution_fba5d745.py | NinaHKivanani/course-content | 3c91dd1a669cebce892486ba4f8086b1ef2e1e49 | [
"CC-BY-4.0"
] | 1 | 2020-06-22T22:57:03.000Z | 2020-06-22T22:57:03.000Z | tutorials/W3D4_DeepLearning1/solutions/W3D4_Tutorial3_Solution_fba5d745.py | NinaHKivanani/course-content | 3c91dd1a669cebce892486ba4f8086b1ef2e1e49 | [
"CC-BY-4.0"
] | 1 | 2021-03-29T21:08:26.000Z | 2021-03-29T21:08:26.000Z | def plot_tuning_curve(resp, ori, ax=None):
"""Plot single neuron responses as a function of stimulus orientation
Args:
resp (numpy array): n_stimuli x n_neurons matrix with responses of each
neuron whose tuning curve to plot. Can also be a 1D array of length
n_stimuli to plot tuning curve of a sin... | 34.226667 | 99 | 0.706272 | def plot_tuning_curve(resp, ori, ax=None):
"""Plot single neuron responses as a function of stimulus orientation
Args:
resp (numpy array): n_stimuli x n_neurons matrix with responses of each
neuron whose tuning curve to plot. Can also be a 1D array of length
n_stimuli to plot tuning curve of a sin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
048379005b2b62f1b01faadba6f978d4f3ede30a | 3,116 | py | Python | tst/inet/ssl/ssl_suite.py | ivankravets/pumbaa | 2a1869cc204e3128516ed6fa9f89529aedec1702 | [
"MIT"
] | 69 | 2016-09-04T18:36:18.000Z | 2021-07-04T21:51:54.000Z | tst/inet/ssl/ssl_suite.py | ivankravets/pumbaa | 2a1869cc204e3128516ed6fa9f89529aedec1702 | [
"MIT"
] | 42 | 2016-09-02T20:10:19.000Z | 2020-07-01T05:54:01.000Z | tst/inet/ssl/ssl_suite.py | ivankravets/pumbaa | 2a1869cc204e3128516ed6fa9f89529aedec1702 | [
"MIT"
] | 11 | 2016-09-29T14:33:23.000Z | 2021-02-28T19:30:49.000Z | #
# @section License
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2017, Erik Moqvist
#
# 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 ... | 30.252427 | 69 | 0.675225 | #
# @section License
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2017, Erik Moqvist
#
# 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 ... | 0 | 0 | 0 | 0 | 0 | 1,636 | 0 | -17 | 180 |
34408d0df213d02bbeba41e708fedfed3c63febc | 9,443 | py | Python | xbmanIntegrated/SCMS/tasks.py | suntao789/Aclsm | 2202201c8279391386a4569e69f93d90eca5b96a | [
"Apache-2.0"
] | 38 | 2018-01-17T03:32:25.000Z | 2021-03-05T03:10:13.000Z | xbmanIntegrated/SCMS/tasks.py | suntao789/Aclsm | 2202201c8279391386a4569e69f93d90eca5b96a | [
"Apache-2.0"
] | null | null | null | xbmanIntegrated/SCMS/tasks.py | suntao789/Aclsm | 2202201c8279391386a4569e69f93d90eca5b96a | [
"Apache-2.0"
] | 17 | 2018-05-29T06:50:10.000Z | 2021-07-08T01:47:22.000Z | #!/usr/bin/env python
#-*- coding:utf-8 -*-
__author__ = 'weihaoxuan'
# import ansible_api
| 43.92093 | 122 | 0.595785 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
__author__ = 'weihaoxuan'
from celery import task
from confile_process import process
import models
import os
# import ansible_api
@task
def nginxdev_push(file,pclist,puthdir):
iplist = []
log = []
confname, path = process().nginx_conf(id=file)
for i in pcli... | 468 | 8,903 | 0 | 0 | 0 | 0 | 0 | -4 | 296 |
1d057d22f7e979ae15ce1bdc1772f344ee6c4a54 | 9,204 | py | Python | readthedocs/builds/querysets.py | shazelquist/readthedocs.org | 25c0f5d9528bd92db3c62db91e8eed8032d01b01 | [
"MIT"
] | null | null | null | readthedocs/builds/querysets.py | shazelquist/readthedocs.org | 25c0f5d9528bd92db3c62db91e8eed8032d01b01 | [
"MIT"
] | 1 | 2022-03-02T11:55:37.000Z | 2022-03-02T11:55:37.000Z | readthedocs/builds/querysets.py | shazelquist/readthedocs.org | 25c0f5d9528bd92db3c62db91e8eed8032d01b01 | [
"MIT"
] | null | null | null | """Build and Version QuerySet classes."""
import logging
log = logging.getLogger(__name__)
__all__ = ['VersionQuerySet', 'BuildQuerySet', 'RelatedBuildQuerySet']
| 32.638298 | 98 | 0.609518 | """Build and Version QuerySet classes."""
import datetime
import logging
from django.db import models
from django.db.models import Q
from django.utils import timezone
from readthedocs.builds.constants import (
BUILD_STATE_FINISHED,
BUILD_STATE_TRIGGERED,
EXTERNAL,
)
from readthedocs.core.permissions impor... | 0 | 0 | 0 | 8,506 | 0 | 0 | 0 | 237 | 292 |
70697284aed98a0a1ec55f4830a7d80f5a7ab937 | 14,978 | py | Python | homeassistant/config/custom_components/smartthinq_sensors/climate.py | yuvalabou/homeassistant | e25885db33d2144455928d07d7e9b044278ba291 | [
"Unlicense"
] | 14 | 2020-03-25T17:14:17.000Z | 2020-04-19T02:03:48.000Z | homeassistant/config/custom_components/smartthinq_sensors/climate.py | yuvalabou/homeassistant | e25885db33d2144455928d07d7e9b044278ba291 | [
"Unlicense"
] | 16 | 2020-03-26T03:32:03.000Z | 2020-04-18T21:28:54.000Z | homeassistant/config/custom_components/smartthinq_sensors/climate.py | yuvalabou/homeassistant | e25885db33d2144455928d07d7e9b044278ba291 | [
"Unlicense"
] | 6 | 2020-03-28T19:41:18.000Z | 2020-04-13T14:04:18.000Z | """Platform for LGE climate integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from typing import Tuple
from .wideq.ac import ACMode
from homeassistant.components.climate.const import (HVACMode)
# general ac attributes
ATTR_FRIDGE = "fridge"
ATTR_FREEZER = "freezer"
HVAC_... | 34.196347 | 85 | 0.664975 | """Platform for LGE climate integration."""
from __future__ import annotations
from dataclasses import dataclass
from datetime import timedelta
import logging
from typing import Any, Awaitable, Callable, List, Tuple
from .wideq import (
FEAT_HUMIDITY,
FEAT_OUT_WATER_TEMP,
UNIT_TEMP_FAHRENHEIT,
DeviceT... | 0 | 5,173 | 3,570 | 3,521 | 0 | 0 | 0 | 621 | 384 |
bc9f8efdc0e855ffa8421ab4eb5c22778be09608 | 34,764 | py | Python | model.py | xuefei1/Graph-Seq2Attn | 336c69877e483c95d9996ee205d2a005342f08af | [
"MIT"
] | 1 | 2020-01-06T07:49:46.000Z | 2020-01-06T07:49:46.000Z | model.py | xuefei1/Graph-Seq2Attn | 336c69877e483c95d9996ee205d2a005342f08af | [
"MIT"
] | 1 | 2020-04-16T10:15:27.000Z | 2020-04-16T16:41:42.000Z | model.py | xuefei1/Graph-Seq2Attn | 336c69877e483c95d9996ee205d2a005342f08af | [
"MIT"
] | null | null | null | import copy
import math
import torch
import torch.nn as nn
def clones(module, n):
"Produce n identical layers."
return nn.ModuleList([copy.deepcopy(module) for _ in range(n)])
def attention(query, key, value, mask=None, dropout=None):
"Compute 'Scaled Dot Product Attention'"
d_k = query.size(-1)
... | 45.984127 | 156 | 0.631544 | import copy
import math
import time
import torch
import torch.nn as nn
import numpy as np
from constants import *
from embeddings import *
from tqdm import tqdm
from utils.model_utils import device, model_checkpoint
from utils.misc_utils import write_line_to_file
from utils.lang_utils import make_std_mask
from evaluate... | 0 | 0 | 0 | 19,658 | 0 | 13,481 | 0 | 83 | 681 |
fbbd84be295788a69019c863fff3289b27d4892b | 4,707 | py | Python | main.py | mode9/xlsxstyle | 6311c6088672d6a39555bd735e1b443583692289 | [
"MIT"
] | null | null | null | main.py | mode9/xlsxstyle | 6311c6088672d6a39555bd735e1b443583692289 | [
"MIT"
] | null | null | null | main.py | mode9/xlsxstyle | 6311c6088672d6a39555bd735e1b443583692289 | [
"MIT"
] | null | null | null | # This Python file uses the following encoding: utf-8
import sys
from PySide2.QtWidgets import QApplication
if __name__ == "__main__":
app = QApplication([sys.executable])
widget = XlsxStyler()
widget.show()
sys.exit(app.exec_())
| 39.554622 | 104 | 0.670066 | # This Python file uses the following encoding: utf-8
import os
import sys
import time
from PyQt5 import QtCore
from PySide2.QtCore import QFile
from PySide2.QtUiTools import QUiLoader
from PySide2.QtWidgets import QApplication, QWidget, QFileDialog, \
QPushButton, QLineEdit, QMessageBox, QTextBrowser, QProgressBa... | 156 | 0 | 0 | 4,062 | 0 | 0 | 0 | 143 | 201 |
22fa8e5db0048c1973b20aac2f2d4320e6b5679e | 2,812 | py | Python | CalibTracker/SiPixelQuality/test/step3_SiPixelStatusAlCaRecoProducer.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | 1 | 2019-08-09T08:42:11.000Z | 2019-08-09T08:42:11.000Z | CalibTracker/SiPixelQuality/test/step3_SiPixelStatusAlCaRecoProducer.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | null | null | null | CalibTracker/SiPixelQuality/test/step3_SiPixelStatusAlCaRecoProducer.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | 1 | 2020-01-10T13:36:46.000Z | 2020-01-10T13:36:46.000Z | import FWCore.ParameterSet.Config as cms
from Configuration.StandardSequences.Eras import eras
process = cms.Process('PCL',eras.Run2_2017)
# ----------------------------------------------------------------------
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.threshold = 'INFO'
proces... | 39.605634 | 121 | 0.771693 | import os
import FWCore.ParameterSet.Config as cms
from Configuration.StandardSequences.Eras import eras
process = cms.Process('PCL',eras.Run2_2017)
# ----------------------------------------------------------------------
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.threshold = 'IN... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
f82068383fbfa605535716b59dcbcbea370cb469 | 1,020 | py | Python | Python/staircase.py | nickhaynes/HackerRank-Challenges | 12be5518251ffde5d19f6ef42795e1c48b6623bd | [
"MIT"
] | null | null | null | Python/staircase.py | nickhaynes/HackerRank-Challenges | 12be5518251ffde5d19f6ef42795e1c48b6623bd | [
"MIT"
] | null | null | null | Python/staircase.py | nickhaynes/HackerRank-Challenges | 12be5518251ffde5d19f6ef42795e1c48b6623bd | [
"MIT"
] | null | null | null | # Consider a staircase of size :
#
# #
# ##
# ###
# ####
#
# Observe that its base and height are both equal to , and the image is drawn using # symbols and spaces. The last line is not preceded by any spaces.
#
# Write a program that prints a staircase of size .
#
# Input Format
#
# A single integer, , deno... | 16.721311 | 150 | 0.590196 | # Consider a staircase of size :
#
# #
# ##
# ###
# ####
#
# Observe that its base and height are both equal to , and the image is drawn using # symbols and spaces. The last line is not preceded by any spaces.
#
# Write a program that prints a staircase of size .
#
# Input Format
#
# A single integer, , deno... | 0 | 0 | 0 | 0 | 0 | 102 | 0 | -53 | 133 |
0023e4346495fa3d50aeae59ada722870a812388 | 271 | py | Python | Algorithm/coding_interviews/Python/sword-for-offer/64_sum_n.py | ck76/awesome-cs | 48cba4081dc5290f07e305850b9a3a7e8a590b64 | [
"Apache-2.0"
] | 1 | 2021-11-16T13:37:41.000Z | 2021-11-16T13:37:41.000Z | Algorithm/coding_interviews/Python/sword-for-offer/64_sum_n.py | ck76/awesome-cs | 48cba4081dc5290f07e305850b9a3a7e8a590b64 | [
"Apache-2.0"
] | null | null | null | Algorithm/coding_interviews/Python/sword-for-offer/64_sum_n.py | ck76/awesome-cs | 48cba4081dc5290f07e305850b9a3a7e8a590b64 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2019/3/10 8:10 PM
# @Author : xiaoliji
# @Email : yutian9527@gmail.com
"""
1+...n
>>> sum_solution(10)
55
"""
| 15.941176 | 38 | 0.546125 | #! /usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2019/3/10 8:10 PM
# @Author : xiaoliji
# @Email : yutian9527@gmail.com
"""
求1+...n, 不能用循环等。
>>> sum_solution(10)
55
"""
def sum_solution(n: int) -> int:
return n and (n+sum_solution(n-1)) | 27 | 0 | 0 | 0 | 0 | 50 | 0 | 0 | 23 |
4336232382e90a34670de18f1e14b8984535e17e | 4,799 | py | Python | docs/plot_visualise.py | vishalbelsare/pycobra | 2af4faa681b412b8508d3043ccaff8e98c1d4368 | [
"MIT"
] | 119 | 2017-03-26T12:11:52.000Z | 2022-03-20T15:17:46.000Z | docs/plot_visualise.py | chrinide/pycobra | 2af4faa681b412b8508d3043ccaff8e98c1d4368 | [
"MIT"
] | 7 | 2017-03-27T12:08:37.000Z | 2018-09-22T10:43:24.000Z | docs/plot_visualise.py | chrinide/pycobra | 2af4faa681b412b8508d3043ccaff8e98c1d4368 | [
"MIT"
] | 22 | 2017-04-12T07:44:09.000Z | 2022-01-13T06:35:29.000Z | """
COBRA Visualisations
--------------------
This notebook will cover the visulaisation and plotting offered by
pycobra.
"""
# %matplotlib inline
import numpy as np
from pycobra.cobra import Cobra
from pycobra.ewa import Ewa
from pycobra.visualisation import Visualisation
# setting up our random data-set
rng = np.... | 27.739884 | 119 | 0.604501 | """
COBRA Visualisations
--------------------
This notebook will cover the visulaisation and plotting offered by
pycobra.
"""
# %matplotlib inline
import numpy as np
from pycobra.cobra import Cobra
from pycobra.ewa import Ewa
from pycobra.visualisation import Visualisation
from pycobra.diagnostics import Diagnostics... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 43 | 44 |
5eae38782b76e9b037188eec504064586659d814 | 384 | py | Python | app/__init__.py | xujl930/crawl_metro | 99c52f183fbf52a43847d98c2d0e666197a73287 | [
"MIT"
] | null | null | null | app/__init__.py | xujl930/crawl_metro | 99c52f183fbf52a43847d98c2d0e666197a73287 | [
"MIT"
] | null | null | null | app/__init__.py | xujl930/crawl_metro | 99c52f183fbf52a43847d98c2d0e666197a73287 | [
"MIT"
] | null | null | null | # -*- coding:utf8 -*-
from flask_mongoengine import MongoEngine
db = MongoEngine() | 21.333333 | 60 | 0.739583 | # -*- coding:utf8 -*-
from flask import Flask
from flask_mongoengine import MongoEngine
from config import config
db = MongoEngine()
def create_app(config_name):
app = Flask(__name__)
app.config.from_object(config[config_name])
db.init_app(app)
from .api_0_1 import api as api_blueprint
app.regi... | 0 | 0 | 0 | 0 | 0 | 227 | 0 | 6 | 68 |
e0f740a7c9719c8085d1dc80c3e3e99aaf3c64b3 | 2,120 | py | Python | practice projects/chap 09/delete unneeded files chap 9/delete unneeded files.py | alperpaksoy/automatetheboringstuff | 6bdb7297c25e2c6588accaea00abcac6872f6df2 | [
"MIT"
] | null | null | null | practice projects/chap 09/delete unneeded files chap 9/delete unneeded files.py | alperpaksoy/automatetheboringstuff | 6bdb7297c25e2c6588accaea00abcac6872f6df2 | [
"MIT"
] | null | null | null | practice projects/chap 09/delete unneeded files chap 9/delete unneeded files.py | alperpaksoy/automatetheboringstuff | 6bdb7297c25e2c6588accaea00abcac6872f6df2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# This program finds files that are above a specified size within
# a specified folder and its subfolders
'''
Write a program that walks through a folder tree and searches for
exceptionally large files or folderssay, ones that have a file size of
more than 100MB. (Remember, to get a files size,... | 32.615385 | 71 | 0.651887 | #!/usr/bin/env python3
# This program finds files that are above a specified size within
# a specified folder and its subfolders
'''
Write a program that walks through a folder tree and searches for
exceptionally large files or folders—say, ones that have a file size of
more than 100MB. (Remember, to get a file’s siz... | 6 | 0 | 0 | 0 | 0 | 25 | 0 | -8 | 44 |
abbcc95a49709a058b3c9645b94868fe5c4bb1f5 | 7,973 | py | Python | custom_components/sensor/car_milage_per_month.py | mar-schmidt/home-assistant-sensor-car-milage | b329b0e1fb26f211d909c747624b502f51017de7 | [
"MIT"
] | null | null | null | custom_components/sensor/car_milage_per_month.py | mar-schmidt/home-assistant-sensor-car-milage | b329b0e1fb26f211d909c747624b502f51017de7 | [
"MIT"
] | null | null | null | custom_components/sensor/car_milage_per_month.py | mar-schmidt/home-assistant-sensor-car-milage | b329b0e1fb26f211d909c747624b502f51017de7 | [
"MIT"
] | null | null | null | """
Configuration:
To use the car_milage_per_month component you will need to add the following to your
configuration.yaml file:
car_milage_per_month:
odometer_sensor: sensor.ete123_odometer (the sensor that holds the total amount of km)
"""
import logging
import voluptuous as vol
import homeassistant.helpers.conf... | 35.435556 | 135 | 0.658723 | """
Configuration:
To use the car_milage_per_month component you will need to add the following to your
configuration.yaml file:
car_milage_per_month:
odometer_sensor: sensor.ete123_odometer (the sensor that holds the total amount of km)
"""
import json
import logging
import calendar
import os
import voluptuous as... | 0 | 410 | 0 | 6,086 | 0 | 0 | 0 | 93 | 179 |
4b4e3ddd829c54567bd78d89e6a6a0b6affd419f | 1,010 | py | Python | portlab/evaluate/lib/backtest.py | sqt-aliu/portlab | 366755c2cfe7bb53c1b236688684fc2c9d8bf4d1 | [
"MIT"
] | 1 | 2017-11-06T06:01:24.000Z | 2017-11-06T06:01:24.000Z | portlab/evaluate/lib/backtest.py | sqt-aliu/portlab | 366755c2cfe7bb53c1b236688684fc2c9d8bf4d1 | [
"MIT"
] | null | null | null | portlab/evaluate/lib/backtest.py | sqt-aliu/portlab | 366755c2cfe7bb53c1b236688684fc2c9d8bf4d1 | [
"MIT"
] | null | null | null | import numpy as np
# core functions
totalreturn = lambda x: (x[-1]/x[0])-1
finalreturn = lambda x: x[-1]
sharpe = lambda x: np.sqrt(12) * (np.mean(x) / np.std(x))
ann_vol = lambda x: np.sqrt(12) * np.std(x)
cagr = lambda x: ((((x[-1]) / x[0])) ** (12.0/(x.count()-1))) - 1
cagr2 = lambda x: ((np.mean(x)+1) ** 12) -1
... | 21.956522 | 65 | 0.447525 | import numpy as np
# core functions
totalreturn = lambda x: (x[-1]/x[0])-1
finalreturn = lambda x: x[-1]
sharpe = lambda x: np.sqrt(12) * (np.mean(x) / np.std(x))
ann_vol = lambda x: np.sqrt(12) * np.std(x)
cagr = lambda x: ((((x[-1]) / x[0])) ** (12.0/(x.count()-1))) - 1
cagr2 = lambda x: ((np.mean(x)+1) ** 12) -1
d... | 0 | 0 | 0 | 0 | 0 | 607 | 0 | 0 | 81 |
18efce23cede35e1ce11c9f84824727b1df23f9d | 2,044 | py | Python | sample_scripts/retarget_campaign.py | decisive/api-demo-python | 58cd14e9e1f6373a3cd927536fd29f5f286940a0 | [
"MIT"
] | null | null | null | sample_scripts/retarget_campaign.py | decisive/api-demo-python | 58cd14e9e1f6373a3cd927536fd29f5f286940a0 | [
"MIT"
] | null | null | null | sample_scripts/retarget_campaign.py | decisive/api-demo-python | 58cd14e9e1f6373a3cd927536fd29f5f286940a0 | [
"MIT"
] | null | null | null | import sys # NOTE: for exiting
import requests
import datetime
import pprint
import ujson as json # NOTE: faster json
API_KEY = '' # TODO: input api key here!!!
if not API_KEY:
sys.exit('Please insert your Decisive API key')
print
print 'Creating session to always add API key...'
# NOTE: you can also use decisi... | 30.507463 | 95 | 0.65362 | import sys # NOTE: for exiting
import requests
import datetime
import pprint
import ujson as json # NOTE: faster json
API_KEY = '' # TODO: input api key here!!!
if not API_KEY:
sys.exit('Please insert your Decisive API key')
print
print 'Creating session to always add API key...'
# NOTE: you can also use decisi... | 0 | 0 | 0 | 0 | 0 | 652 | 0 | 0 | 91 |
9975b4944c84ea643a71a8fe95b55e6ebcf03607 | 342 | py | Python | taaontia/commands/registry.py | Kagaminara/taaontia.py | 5f31f22fd26767903f8351eab209848fe1ddb6b0 | [
"MIT"
] | null | null | null | taaontia/commands/registry.py | Kagaminara/taaontia.py | 5f31f22fd26767903f8351eab209848fe1ddb6b0 | [
"MIT"
] | null | null | null | taaontia/commands/registry.py | Kagaminara/taaontia.py | 5f31f22fd26767903f8351eab209848fe1ddb6b0 | [
"MIT"
] | null | null | null |
commands = CommandsRegistry()
| 21.375 | 56 | 0.652047 | class CommandsRegistry:
def __init__(self):
self.commands = {}
def register(self, command):
self.commands[command.trigger] = command()
return command
def get(self, command):
from .helper import HelpCommand
return self.commands.get(command, HelpCommand())
commands... | 0 | 0 | 0 | 288 | 0 | 0 | 0 | 0 | 22 |
de76335bf95488a9cd521c5b94630a6f3bfab345 | 24,150 | py | Python | src/graph_transpiler/webdnn/frontend/tensorflow/ops/gen_nn_ops.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | 1 | 2021-04-09T15:55:35.000Z | 2021-04-09T15:55:35.000Z | src/graph_transpiler/webdnn/frontend/tensorflow/ops/gen_nn_ops.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | null | null | null | src/graph_transpiler/webdnn/frontend/tensorflow/ops/gen_nn_ops.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | null | null | null |
from webdnn.frontend.tensorflow.converter import TensorFlowConverter
from webdnn.frontend.tensorflow.util import unary_op_handler
from webdnn.graph.operators.elu import Elu
from webdnn.graph.operators.relu import Relu
from webdnn.graph.operators.softsign import Softsign
TensorFlowConverter.reg... | 42.592593 | 135 | 0.755735 | from typing import Tuple, List
import numpy as np
import tensorflow as tf
from webdnn.frontend.tensorflow.converter import TensorFlowConverter
from webdnn.frontend.tensorflow.util import unary_op_handler, check_data_format, convert_odd_padding_to_concat, parse_padding
from webdnn.graph.axis import Axis
from webdnn.gr... | 0 | 21,356 | 0 | 0 | 0 | 0 | 0 | 460 | 1,780 |
7162d76d7a0f15ece55362aaf305b6e9001bee7f | 673 | py | Python | GF2.py | JediKoder/coursera-CodeMatrix | 1ac461d22ebaf2777eabdcf31d76d709c33f472a | [
"MIT"
] | 6 | 2015-09-18T02:07:21.000Z | 2020-04-22T17:05:11.000Z | GF2.py | JediKoder/coursera-CodeMatrix | 1ac461d22ebaf2777eabdcf31d76d709c33f472a | [
"MIT"
] | null | null | null | GF2.py | JediKoder/coursera-CodeMatrix | 1ac461d22ebaf2777eabdcf31d76d709c33f472a | [
"MIT"
] | 10 | 2015-09-05T03:54:00.000Z | 2020-04-21T12:56:40.000Z |
one = One()
zero = 0
| 25.884615 | 62 | 0.644874 | from numbers import Number
class One:
def __add__(self, other): return self if other == 0 else 0
__sub__ = __add__
def __mul__(self, other):
if isinstance(other, Number):
return 0 if other == 0 else self
return other
def __div__(self, other):
if other == 0: raise Zer... | 0 | 0 | 0 | 601 | 0 | 0 | 0 | 5 | 45 |
1cf508199cbd0764682bf5bdcd24b98f81e53734 | 1,151 | py | Python | tonks/vision/helpers.py | vanderveld/tonks | e87afbd9614b276b443b4a7527fd1fda01a8be4c | [
"BSD-3-Clause"
] | null | null | null | tonks/vision/helpers.py | vanderveld/tonks | e87afbd9614b276b443b4a7527fd1fda01a8be4c | [
"BSD-3-Clause"
] | null | null | null | tonks/vision/helpers.py | vanderveld/tonks | e87afbd9614b276b443b4a7527fd1fda01a8be4c | [
"BSD-3-Clause"
] | null | null | null | from creevey.ops.image import centercrop
import numpy as np
from PIL import Image
import torch.nn as nn
def center_crop_pil_image(img):
"""
Helper function to crop the center out of images.
Utilizes the centercrop function from `creevey`
Parameters
----------
img: array
PIL image arr... | 24.489362 | 85 | 0.638575 | from creevey.ops.image import centercrop
import numpy as np
from PIL import Image
import torch.nn as nn
def center_crop_pil_image(img):
"""
Helper function to crop the center out of images.
Utilizes the centercrop function from `creevey`
Parameters
----------
img: array
PIL image arr... | 0 | 0 | 0 | 360 | 0 | 182 | 0 | 0 | 46 |
711d9ac3055874d62d06bdb20403fb0a203b8348 | 8,608 | py | Python | cornflow_client/schema/manager.py | baobabsoluciones/cornflow-client | f9996f0b841885d26639cb63c8ba6090387de57f | [
"MIT"
] | 3 | 2021-05-12T11:21:26.000Z | 2022-02-22T19:23:46.000Z | cornflow_client/schema/manager.py | baobabsoluciones/cornflow-client | f9996f0b841885d26639cb63c8ba6090387de57f | [
"MIT"
] | 17 | 2021-03-14T17:09:46.000Z | 2022-02-28T19:12:37.000Z | cornflow_client/schema/manager.py | baobabsoluciones/cornflow-client | f9996f0b841885d26639cb63c8ba6090387de57f | [
"MIT"
] | 2 | 2020-10-03T20:00:19.000Z | 2022-03-24T11:52:22.000Z | """
Class to help create and manage data schema and to validate json files.
"""
| 31.188406 | 106 | 0.580507 | """
Class to help create and manage data schema and to validate json files.
"""
from jsonschema import Draft7Validator
from copy import deepcopy
from genson import SchemaBuilder
from .dictSchema import DictSchema
from cornflow_client.core.tools import load_json, save_json
class SchemaManager:
"""
A schema ma... | 0 | 2,306 | 0 | 6,004 | 0 | 0 | 0 | 83 | 134 |
0048849928d11e99a79abed4f15fdfd4ce533927 | 1,461 | py | Python | src/summary/trigger.py | latonaio/template-matching-summary-server | 2f0e792d38f897a08d6f792012dbfdad6d7c695b | [
"MIT"
] | 9 | 2021-09-22T07:17:02.000Z | 2021-11-05T01:26:19.000Z | src/summary/trigger.py | latonaio/template-matching-summary-server | 2f0e792d38f897a08d6f792012dbfdad6d7c695b | [
"MIT"
] | null | null | null | src/summary/trigger.py | latonaio/template-matching-summary-server | 2f0e792d38f897a08d6f792012dbfdad6d7c695b | [
"MIT"
] | null | null | null | from src import log
if __name__ == "__main__":
import json
with open('json/C_TemplateMatchingSummary.json') as f:
_dict = json.load(f)
dicts = _dict['metadata'][0]['value']
summary = TriggerSummary()
should_be_reset = summary.should_be_reset(dicts)
log.print(should_be_reset)
if s... | 22.828125 | 93 | 0.603696 | from src import log
from src.summary.base import BaseSummary
class TriggerSummary(BaseSummary):
def __init__(self):
self.vehicle_name = None
self.reset()
def reset(self):
super().reset()
return
def should_be_reset(self, dicts):
new_vehicle_name = None
if d... | 0 | 0 | 0 | 821 | 0 | 0 | 0 | 19 | 45 |
8ab448056412da458a047ede6337a58d5e53cdfb | 195 | py | Python | thrift/protocol/__init__.py | getlove555/getbotline | 639e157495849e12ac7dd4bae6012841cf511892 | [
"MIT"
] | 7 | 2020-04-30T09:03:36.000Z | 2021-02-21T17:45:35.000Z | thrift/protocol/__init__.py | getlove555/getbotline | 639e157495849e12ac7dd4bae6012841cf511892 | [
"MIT"
] | 4 | 2020-08-01T10:10:14.000Z | 2021-01-03T00:55:05.000Z | thrift/protocol/__init__.py | LOUREN03/lourenelle | 5448a8634d438f35df98e43ad135f232cf74d2b1 | [
"MIT"
] | 20 | 2020-05-11T08:53:30.000Z | 2021-07-16T09:50:20.000Z | #LICENCE : http://www.apache.org/licenses/LICENSE-2.0
#CREATOR BY : PRANKBOT
#MOD BY ACIL
__all__ = ['fastbinary', 'TBase', 'TBinaryProtocol', 'TCompactProtocol', 'TJSONProtocol', 'TProtocol']
| 39 | 102 | 0.723077 | #LICENCE : http://www.apache.org/licenses/LICENSE-2.0
#CREATOR BY : PRANKBOT
#MOD BY ACIL
__all__ = ['fastbinary', 'TBase', 'TBinaryProtocol', 'TCompactProtocol', 'TJSONProtocol', 'TProtocol']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
63eaa450af3c58a5dba398f2348a71fa45fd20c0 | 2,693 | py | Python | navigation_events.py | gkovacs/invideo-quizzes-analysis-las2016 | 6ec8686ef0d3ffa5e994f8dec41590fea87e9539 | [
"MIT"
] | null | null | null | navigation_events.py | gkovacs/invideo-quizzes-analysis-las2016 | 6ec8686ef0d3ffa5e994f8dec41590fea87e9539 | [
"MIT"
] | null | null | null | navigation_events.py | gkovacs/invideo-quizzes-analysis-las2016 | 6ec8686ef0d3ffa5e994f8dec41590fea87e9539 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# md5: a2cb6a826f222fa843ab488ae8a2de22
# coding: utf-8
| 29.593407 | 74 | 0.680654 | #!/usr/bin/env python
# md5: a2cb6a826f222fa843ab488ae8a2de22
# coding: utf-8
import json
class SeekEvent:
def __init__(self, timestamp, start, end, paused, user):
self.timestamp = timestamp
self.start = start
self.end = end
self.event_type = 'seeked'
self.paused = bool(paused)
if self.end >... | 0 | 0 | 0 | 2,463 | 0 | 0 | 0 | -10 | 161 |
9930cfc3b8857f7d8d5760e9dc01072e8dcd4337 | 1,665 | py | Python | sketch n draw.py | Ayush2007A/Code-master | fafe4a020adc3f8e78c78f6b8b2b08b5c3005613 | [
"Unlicense"
] | 1 | 2021-02-05T10:29:30.000Z | 2021-02-05T10:29:30.000Z | sketch n draw.py | Ayush2007A/Code-master | fafe4a020adc3f8e78c78f6b8b2b08b5c3005613 | [
"Unlicense"
] | null | null | null | sketch n draw.py | Ayush2007A/Code-master | fafe4a020adc3f8e78c78f6b8b2b08b5c3005613 | [
"Unlicense"
] | null | null | null | import turtle
from turtle import Screen
a = turtle.Turtle()
screen = Screen()
a.shape('turtle')
print('Welcome to sketch n draw')
print('select your color 1 and 2')
color_1 = (input('color 1: '))
color_2 = (input('color 2: '))
print('ok! your colors are ' + color_1 + (' and ') + color_2)
print("changed pad's ... | 30.833333 | 83 | 0.493093 | import turtle
from turtle import Turtle, Screen
a = turtle.Turtle()
screen = Screen()
a.shape('turtle')
print('Welcome to sketch n draw')
print('select your color 1 and 2')
color_1 = (input('color 1: '))
color_2 = (input('color 2: '))
print('ok! your colors are ' + color_1 + (' and ') + color_2)
print("change... | 0 | 0 | 0 | 0 | 0 | 251 | 0 | 8 | 93 |
60bade3775753250997ff137e10f278ae7d7d12a | 5,476 | py | Python | examples/slit_channel.py | cwaluga/singularities_dolfin | dd379f71f384717a63906fd701df542a1603b03b | [
"MIT"
] | null | null | null | examples/slit_channel.py | cwaluga/singularities_dolfin | dd379f71f384717a63906fd701df542a1603b03b | [
"MIT"
] | null | null | null | examples/slit_channel.py | cwaluga/singularities_dolfin | dd379f71f384717a63906fd701df542a1603b03b | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# coding=utf-8
"""
Example from the paper Rde/Waluga/Wohlmuth 2013
"""
__author__ = "Christian Waluga (waluga@ma.tum.de)"
__copyright__ = "Copyright (c) 2013 %s" % __author__
import math
set_log_level(ERROR)
# convergence rates
# boundary definition for error
if __name__ == '__main__':... | 30.764045 | 164 | 0.649379 | #! /usr/bin/env python
# coding=utf-8
"""
Example from the paper Rüde/Waluga/Wohlmuth 2013
"""
__author__ = "Christian Waluga (waluga@ma.tum.de)"
__copyright__ = "Copyright (c) 2013 %s" % __author__
from dolfin import *
from energy_correction.correction import *
from energy_correction.meshtools import *
from energy... | 2 | 0 | 0 | 89 | 0 | 1,339 | 0 | 81 | 178 |
a7c5fe548eda7fb588f956399f68c6d16da1faec | 1,314 | py | Python | ca_on_wellesley/people.py | dcycle/scrapers-ca | 4c7a6cd01d603221b5b3b7a400d2e5ca0c6e916f | [
"MIT"
] | 19 | 2015-05-26T03:18:50.000Z | 2022-01-31T03:27:41.000Z | ca_on_wellesley/people.py | dcycle/scrapers-ca | 4c7a6cd01d603221b5b3b7a400d2e5ca0c6e916f | [
"MIT"
] | 119 | 2015-01-09T06:09:35.000Z | 2022-01-20T23:05:05.000Z | ca_on_wellesley/people.py | dcycle/scrapers-ca | 4c7a6cd01d603221b5b3b7a400d2e5ca0c6e916f | [
"MIT"
] | 17 | 2015-11-23T05:00:10.000Z | 2021-09-15T16:03:33.000Z |
COUNCIL_PAGE = 'http://www.wellesley.ca/council/councillors/?q=council/councillors'
| 34.578947 | 95 | 0.571537 | from utils import CanadianScraper, CanadianPerson as Person
import re
COUNCIL_PAGE = 'http://www.wellesley.ca/council/councillors/?q=council/councillors'
def post_number(name):
return {
'Ward One': 'Ward 1',
'Ward Two': 'Ward 2',
'Ward Three': 'Ward 3',
'Ward Four': 'Ward 4'
}... | 0 | 0 | 0 | 963 | 0 | 148 | 0 | 26 | 90 |
fb53dcf3b5f85da5350281d96e99a77c6877114e | 1,261 | py | Python | api/client/src/test/test_update_cluster_bad_request_exception_response_content.py | maclema/aws-parallelcluster | ade6e5e76201ee43c6e222fcd1c2891aba938838 | [
"Apache-2.0"
] | 415 | 2018-11-13T15:02:15.000Z | 2022-03-31T15:26:06.000Z | api/client/src/test/test_update_cluster_bad_request_exception_response_content.py | maclema/aws-parallelcluster | ade6e5e76201ee43c6e222fcd1c2891aba938838 | [
"Apache-2.0"
] | 2,522 | 2018-11-13T16:16:27.000Z | 2022-03-31T13:57:10.000Z | api/client/src/test/test_update_cluster_bad_request_exception_response_content.py | yuleiwan/aws-parallelcluster | aad2a3019ef4ad08d702f5acf41b152b3f7a0b46 | [
"Apache-2.0"
] | 164 | 2018-11-14T22:47:46.000Z | 2022-03-22T11:33:22.000Z | """
ParallelCluster
ParallelCluster API # noqa: E501
The version of the OpenAPI document: 3.0.0
Generated by: https://openapi-generator.tech
"""
import unittest
from pcluster.client.model.change import Change
from pcluster.client.model.config_validation_message import ConfigValidationMessage
from pc... | 30.02381 | 135 | 0.77954 | """
ParallelCluster
ParallelCluster API # noqa: E501
The version of the OpenAPI document: 3.0.0
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import pcluster.client
from pcluster.client.model.change import Change
from pcluster.client.model.config_validation_message im... | 0 | 0 | 0 | 513 | 0 | 0 | 0 | 104 | 91 |
87793261619b7cb430625fdd5dd5441808c7b619 | 2,864 | py | Python | qiskit/providers/aer/pulse/de_solvers/pulse_de_solver.py | SooluThomas/qiskit-aer | 1602b1cc35a18f5a008c38433f607c7ad0870ce9 | [
"Apache-2.0"
] | 1 | 2019-05-19T10:30:03.000Z | 2019-05-19T10:30:03.000Z | qiskit/providers/aer/pulse/de_solvers/pulse_de_solver.py | stefan-woerner/qiskit-aer | cef92153dad6e9acded627b2e3cb10c5a1d7851a | [
"Apache-2.0"
] | null | null | null | qiskit/providers/aer/pulse/de_solvers/pulse_de_solver.py | stefan-woerner/qiskit-aer | cef92153dad6e9acded627b2e3cb10c5a1d7851a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#... | 33.302326 | 77 | 0.641411 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#... | 0 | 0 | 0 | 348 | 0 | 0 | 0 | 17 | 45 |
8424167fac0970dd1983c3a928d7777a5ac90453 | 190 | py | Python | TEST/RPLCD_CharLCD.py | sireline/raspi | f3f1879d3c8cc4e702b8f0f7c5fcc4d9bf5901c1 | [
"MIT"
] | null | null | null | TEST/RPLCD_CharLCD.py | sireline/raspi | f3f1879d3c8cc4e702b8f0f7c5fcc4d9bf5901c1 | [
"MIT"
] | 1 | 2019-03-14T11:42:15.000Z | 2019-03-14T11:42:15.000Z | TEST/RPLCD_CharLCD.py | sireline/raspi | f3f1879d3c8cc4e702b8f0f7c5fcc4d9bf5901c1 | [
"MIT"
] | null | null | null | from RPLCD import CharLCD
import RPi.GPIO as GPIO
lcd = CharLCD(numbering_mode=GPIO.BOARD, cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33, 31, 29, 23])
lcd.write_string(u'Hello World')
| 38 | 106 | 0.752632 | from RPLCD import CharLCD
import RPi.GPIO as GPIO
lcd = CharLCD(numbering_mode=GPIO.BOARD, cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[33, 31, 29, 23])
lcd.write_string(u'Hello World')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
30ac7343bb8e51ff66295aa68294f848fe139c9b | 14,856 | py | Python | indicators/tests/iptt_tests/indicator_report_data_queries.py | mercycorps/toladata | 4d5f9b45905a81af9981b586690e020d5b3bfc60 | [
"Apache-2.0"
] | null | null | null | indicators/tests/iptt_tests/indicator_report_data_queries.py | mercycorps/toladata | 4d5f9b45905a81af9981b586690e020d5b3bfc60 | [
"Apache-2.0"
] | 268 | 2020-03-31T15:46:59.000Z | 2022-03-31T18:01:08.000Z | indicators/tests/iptt_tests/indicator_report_data_queries.py | mercycorps/toladata | 4d5f9b45905a81af9981b586690e020d5b3bfc60 | [
"Apache-2.0"
] | 1 | 2021-01-05T01:58:24.000Z | 2021-01-05T01:58:24.000Z | """Tests for the IPTT Report Data Indicators (TP/TVA) to ensure their query counts stay O(n) and not O(n^2)
- api_report_data takes program_pk and frequency, calls IPTT<TVA/TP>ReportIndicatorSerializer.load_report
- IPTT<TVA/TP>ReportIndicatorSerializer.load_report takes program_pk and frequency
- quer... | 54.021818 | 117 | 0.580506 | """Tests for the IPTT Report Data Indicators (TP/TVA) to ensure their query counts stay O(n) and not O(n^2)
- api_report_data takes program_pk and frequency, calls IPTT<TVA/TP>ReportIndicatorSerializer.load_report
- IPTT<TVA/TP>ReportIndicatorSerializer.load_report takes program_pk and frequency
- quer... | 0 | 2,622 | 0 | 10,786 | 0 | 0 | 0 | 113 | 91 |
5dfc3ef0fa75c74b1c61d2f529a6109260b3259f | 4,081 | py | Python | MAOL/personal_list/models.py | noxlock/my-anime-openings-list | 4ab7660f226af5f06b941c657b8ff611ec8c63bc | [
"MIT"
] | null | null | null | MAOL/personal_list/models.py | noxlock/my-anime-openings-list | 4ab7660f226af5f06b941c657b8ff611ec8c63bc | [
"MIT"
] | 4 | 2021-12-31T07:56:10.000Z | 2021-12-31T09:43:27.000Z | MAOL/personal_list/models.py | noxlock/my-anime-openings-list | 4ab7660f226af5f06b941c657b8ff611ec8c63bc | [
"MIT"
] | null | null | null | from django.db.models.signals import post_save
from django.contrib.auth.models import User
# On User creation, make a profile as well
post_save.connect(create_profile, sender=User)
# On User creation, make a profile as well
post_save.connect(create_songlist, sender=User)
| 30.684211 | 114 | 0.666503 | from django.db import models
from django.db.models.signals import post_save
from django.contrib.auth.models import User
from django.core.validators import MaxValueValidator
from imagekit.models import ProcessedImageField
from imagekit.processors import ResizeToFill
from home.models import ModelAbstract, Song
class ... | 0 | 0 | 0 | 3,268 | 0 | 196 | 0 | 109 | 225 |
9afa88946cd84c21fe6fd73d3c1f70f534351283 | 192 | py | Python | backend/app/db/mongodb.py | soumitdas/xmeme | a0a39c55e1cb11f9cd3d001f88df88d2913efbd9 | [
"MIT"
] | null | null | null | backend/app/db/mongodb.py | soumitdas/xmeme | a0a39c55e1cb11f9cd3d001f88df88d2913efbd9 | [
"MIT"
] | null | null | null | backend/app/db/mongodb.py | soumitdas/xmeme | a0a39c55e1cb11f9cd3d001f88df88d2913efbd9 | [
"MIT"
] | null | null | null |
db = Database() | 21.333333 | 50 | 0.776042 | from motor.motor_asyncio import AsyncIOMotorClient
class Database:
client: AsyncIOMotorClient = None
db = Database()
async def get_database() -> AsyncIOMotorClient:
return db.client | 0 | 0 | 47 | 32 | 0 | 0 | 0 | 29 | 68 |
1873b48a08443ccfc17f1f4b9fdf04d22a02923d | 2,785 | py | Python | shrinky/glsl_block_struct.py | xyproto/shrinky | 8f318d2f62f8ef3cffae6bd5db1b36c95067aac6 | [
"BSD-3-Clause"
] | 11 | 2019-03-16T11:03:50.000Z | 2021-12-26T12:41:57.000Z | shrinky/glsl_block_struct.py | xyproto/shrinky | 8f318d2f62f8ef3cffae6bd5db1b36c95067aac6 | [
"BSD-3-Clause"
] | 1 | 2022-02-12T16:22:37.000Z | 2022-02-12T16:22:37.000Z | shrinky/glsl_block_struct.py | xyproto/shrinky | 8f318d2f62f8ef3cffae6bd5db1b36c95067aac6 | [
"BSD-3-Clause"
] | null | null | null | from shrinky.glsl_block import extract_tokens
from shrinky.glsl_block_member import glsl_parse_member_list
########################################
# GlslBlockStruct ######################
########################################
########################################
# Functions ############################
#####... | 30.944444 | 98 | 0.560144 | from shrinky.glsl_block import GlslBlock
from shrinky.glsl_block import extract_tokens
from shrinky.glsl_block_member import glsl_parse_member_list
########################################
# GlslBlockStruct ######################
########################################
class GlslBlockStruct(GlslBlock):
"""Struc... | 0 | 0 | 0 | 1,424 | 0 | 0 | 0 | 19 | 45 |
1a50f81d932843336b3e69b5e740b3960191e4df | 638 | py | Python | wtiproj04/zad_6_mean_user.py | kwitnacy/wti | 9ee659bf2912f5b2fe6229bbda5074d4f3ebb3d4 | [
"Apache-2.0"
] | null | null | null | wtiproj04/zad_6_mean_user.py | kwitnacy/wti | 9ee659bf2912f5b2fe6229bbda5074d4f3ebb3d4 | [
"Apache-2.0"
] | null | null | null | wtiproj04/zad_6_mean_user.py | kwitnacy/wti | 9ee659bf2912f5b2fe6229bbda5074d4f3ebb3d4 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
user_ID = 78
query = 'userID == ' + str(user_ID)
# head = my_join()
head = ['Action', 'Adventure', 'Animation', 'Children', 'Comedy', 'Crime', 'Documentary', 'Drama', 'Fantasy', 'Film-Noir', 'Horror', 'IMAX', 'Musical', 'Mystery', 'Romance', 'Sci-Fi', 'Short', 'Thriller', 'War',... | 39.875 | 222 | 0.661442 | import pandas as pd
import numpy as np
from typing import List
user_ID = 78
query = 'userID == ' + str(user_ID)
# head = my_join()
head = ['Action', 'Adventure', 'Animation', 'Children', 'Comedy', 'Crime', 'Documentary', 'Drama', 'Fantasy', 'Film-Noir', 'Horror', 'IMAX', 'Musical', 'Mystery', 'Romance', 'Sci-Fi', 'Sh... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 22 |
7a5e99161a963ae3dbd40cd45ad6fc98263f2ffb | 1,698 | py | Python | uPython/clock/main.py | c3dprk/split-flap | 0b4a8bc4e540f38ad24d0b790ed6268a0b832a2f | [
"MIT"
] | 13 | 2017-12-11T12:25:49.000Z | 2022-03-02T11:44:09.000Z | uPython/clock/main.py | c3dprk/split-flap | 0b4a8bc4e540f38ad24d0b790ed6268a0b832a2f | [
"MIT"
] | null | null | null | uPython/clock/main.py | c3dprk/split-flap | 0b4a8bc4e540f38ad24d0b790ed6268a0b832a2f | [
"MIT"
] | 6 | 2018-01-01T16:15:48.000Z | 2020-04-07T23:44:03.000Z | from machine import Pin, RTC
from time import sleep
from json import load as jload
from ntptime import settime
ADDR_DELAY_US = 100
GOTO_DELAY_MS = 20
HOUR_LUT = jload(open("hour_lut.json"))
MINUTE_LUT = jload(open("minute_lut.json"))
TIME_ZONE = +2
encoder_pins = [Pin(i, Pin.IN, Pin.PULL_UP) for i in [0, 2, 4, 5, 12,... | 19.744186 | 74 | 0.59894 | from machine import Pin, RTC
from time import sleep, sleep_ms, sleep_us
from json import load as jload
from ntptime import settime
ADDR_DELAY_US = 100
GOTO_DELAY_MS = 20
HOUR_LUT = jload(open("hour_lut.json"))
MINUTE_LUT = jload(open("minute_lut.json"))
TIME_ZONE = +2
encoder_pins = [Pin(i, Pin.IN, Pin.PULL_UP) for i... | 0 | 0 | 0 | 0 | 0 | 951 | 0 | 20 | 184 |
5cfc29885daabd72bd7e5d74a2904b6dbfab5b1f | 866 | py | Python | conftest.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 2,706 | 2018-04-05T18:28:50.000Z | 2022-03-29T16:56:59.000Z | conftest.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 242 | 2018-04-05T22:30:42.000Z | 2022-03-19T01:55:11.000Z | conftest.py | MatPoliquin/retro | c70c174a9818d1e97bc36e61abb4694d28fc68e1 | [
"MIT-0",
"MIT"
] | 464 | 2018-04-05T19:10:34.000Z | 2022-03-28T13:33:32.000Z | import retro.data
inttypes = {
'exp': retro.data.Integrations.EXPERIMENTAL_ONLY,
'contrib': retro.data.Integrations.CONTRIB_ONLY,
}
| 32.074074 | 129 | 0.572748 | import pytest
import retro.data
inttypes = {
'exp': retro.data.Integrations.EXPERIMENTAL_ONLY,
'contrib': retro.data.Integrations.CONTRIB_ONLY,
}
def pytest_collection_modifyitems(items):
def test(*args, **kwargs):
print(kwargs)
return False
for item in items:
if item.origina... | 0 | 0 | 0 | 0 | 0 | 687 | 0 | -8 | 45 |
67146385598397f73fdfde407de56e453e1380c1 | 266 | py | Python | examples/futures/market/funding_rate.py | AlfonsoAgAr/binance-futures-connector-python | f0bd2c7b0576503bf526ce6be329ca2dae90fefe | [
"MIT"
] | 58 | 2021-11-22T11:46:27.000Z | 2022-03-30T06:58:53.000Z | examples/futures/market/funding_rate.py | sanjeevan121/binance-futures-connector-python | d820b73a15e9f64c80891a13694ca0c5d1693b90 | [
"MIT"
] | 15 | 2021-12-15T22:40:52.000Z | 2022-03-29T22:08:31.000Z | examples/futures/market/funding_rate.py | sanjeevan121/binance-futures-connector-python | d820b73a15e9f64c80891a13694ca0c5d1693b90 | [
"MIT"
] | 28 | 2021-12-10T03:56:13.000Z | 2022-03-25T22:23:44.000Z | #!/usr/bin/env python
from binance.futures import Futures as Client
import logging
from binance.lib.utils import config_logging
config_logging(logging, logging.DEBUG)
futures_client = Client()
logging.info(futures_client.funding_rate("BTCUSDT",**{'limit':100}))
| 22.166667 | 68 | 0.793233 | #!/usr/bin/env python
from binance.futures import Futures as Client
import logging
from binance.lib.utils import config_logging
config_logging(logging, logging.DEBUG)
futures_client = Client()
logging.info(futures_client.funding_rate("BTCUSDT",**{'limit':100}))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6a497cd03b5c018bcfd778acb4c7bc5cc9a8d147 | 7,904 | py | Python | perfkitbenchmarker/providers/aws/aws_capacity_reservation.py | Nowasky/PerfKitBenchmarker | cfa88e269eb373780910896ed4bdc8db09469753 | [
"Apache-2.0"
] | 3 | 2018-04-28T13:06:14.000Z | 2020-06-09T02:39:44.000Z | perfkitbenchmarker/providers/aws/aws_capacity_reservation.py | Nowasky/PerfKitBenchmarker | cfa88e269eb373780910896ed4bdc8db09469753 | [
"Apache-2.0"
] | 1 | 2021-09-09T07:43:25.000Z | 2021-09-09T10:47:56.000Z | perfkitbenchmarker/providers/aws/aws_capacity_reservation.py | Nowasky/PerfKitBenchmarker | cfa88e269eb373780910896ed4bdc8db09469753 | [
"Apache-2.0"
] | 6 | 2019-06-11T18:59:57.000Z | 2021-03-02T19:14:42.000Z | # Copyright 2019 PerfKitBenchmarker 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 appli... | 39.52 | 80 | 0.711285 | # Copyright 2019 PerfKitBenchmarker 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 appli... | 0 | 0 | 0 | 5,614 | 0 | 0 | 0 | 109 | 291 |
cb4016d8c942b829044e83083af5b694d65e6752 | 519 | py | Python | jieba-0.38/jieba/analyse/__init__.py | scmsqhn/changhongmall | 41ce7a42e6484be0e4d4d3912b9e23b96a281d4a | [
"MIT"
] | 2 | 2016-02-13T08:36:45.000Z | 2017-05-07T22:43:34.000Z | jieba-0.38/jieba/analyse/__init__.py | scmsqhn/changhongmall | 41ce7a42e6484be0e4d4d3912b9e23b96a281d4a | [
"MIT"
] | null | null | null | jieba-0.38/jieba/analyse/__init__.py | scmsqhn/changhongmall | 41ce7a42e6484be0e4d4d3912b9e23b96a281d4a | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from .tfidf import TFIDF
from .textrank import TextRank
try:
except ImportError:
pass
default_tfidf = TFIDF()
default_textrank = TextRank()
extract_tags = tfidf = default_tfidf.extract_tags
set_idf_path = default_tfidf.set_idf_path
textrank = default_textrank.ext... | 27.315789 | 53 | 0.797688 | from __future__ import absolute_import
from .tfidf import TFIDF
from .textrank import TextRank
try:
from .analyzer import ChineseAnalyzer
except ImportError:
pass
default_tfidf = TFIDF()
default_textrank = TextRank()
extract_tags = tfidf = default_tfidf.extract_tags
set_idf_path = default_tfidf.se... | 0 | 0 | 0 | 0 | 0 | 120 | 0 | 16 | 52 |
267f7a0745f4981f02d8619bb346037688232eb9 | 12,792 | py | Python | elastica/rod/factory_function.py | bhosale2/PyElastica | 520374672cbd6b0c89a912c5019559e66c5535e3 | [
"MIT"
] | null | null | null | elastica/rod/factory_function.py | bhosale2/PyElastica | 520374672cbd6b0c89a912c5019559e66c5535e3 | [
"MIT"
] | null | null | null | elastica/rod/factory_function.py | bhosale2/PyElastica | 520374672cbd6b0c89a912c5019559e66c5535e3 | [
"MIT"
] | null | null | null | __doc__ = """ Factory function to allocate variables for Cosserat Rod"""
__all__ = ["allocate"]
import numpy as np
from numpy.testing import assert_allclose
from elastica.utils import MaxDimension, Tolerance
from elastica._linalg import _batch_cross, _batch_norm
def _position_validity_checker(position, start, n_el... | 34.021277 | 123 | 0.636413 | __doc__ = """ Factory function to allocate variables for Cosserat Rod"""
__all__ = ["allocate"]
import typing
from typing import Optional, Tuple
import warnings
import logging
import numpy as np
from numpy.testing import assert_allclose
from elastica.utils import MaxDimension, Tolerance
from elastica._linalg import _ba... | 0 | 0 | 0 | 0 | 0 | 10,412 | 0 | 4 | 157 |
edebf6391ea5ad0a5b7782e9f778bed9cb045eb3 | 356 | py | Python | rl_vs_rand.py | yangmuzhi/wuziqi | 7bdee51ef2a37373b0823b00c4536138560ec3bb | [
"MIT"
] | null | null | null | rl_vs_rand.py | yangmuzhi/wuziqi | 7bdee51ef2a37373b0823b00c4536138560ec3bb | [
"MIT"
] | null | null | null | rl_vs_rand.py | yangmuzhi/wuziqi | 7bdee51ef2a37373b0823b00c4536138560ec3bb | [
"MIT"
] | null | null | null | from env_wrapper import wzq_env
from policy.rand_policy import rand_agent
from policy.rl_policy import ppo_agent
agent0 = ppo_agent(size=15)
agent1 = rand_agent(size=15)
env = wzq_env([agent0, agent1])
env.run() | 27.384615 | 41 | 0.814607 | from env_wrapper import wzq_env
from policy.rand_policy import rand_agent
from policy.algo.ppo import PPO
from policy.net.net_v0 import policy_net
from policy.net.net_v0 import value_net
from policy.rl_policy import ppo_agent
import time
import numpy as np
agent0 = ppo_agent(size=15)
agent1 = rand_agent(size=15)
env =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 110 |
7f879e3d16877aed4273aa22fc10b7ba833b6e0c | 2,494 | py | Python | catalog/bindings/gmd/md_application_schema_information_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/md_application_schema_information_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/md_application_schema_information_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null |
__NAMESPACE__ = "http://www.isotc211.org/2005/gmd"
| 31.974359 | 84 | 0.607859 | from dataclasses import dataclass, field
from typing import Optional
from bindings.gmd.abstract_object_type import AbstractObjectType
from bindings.gmd.binary_property_type import BinaryPropertyType
from bindings.gmd.character_string_property_type import CharacterStringPropertyType
from bindings.gmd.ci_citation_type im... | 0 | 2,070 | 0 | 0 | 0 | 0 | 0 | 216 | 155 |
ff3169fa89df03f86c76a1e4195a8f9a48e7d51f | 5,733 | py | Python | semibandits/plotting_script.py | akshaykr/oracle_cb | 68f10fce5eca8ebe3f57fd5a56a0ef8d82537ab4 | [
"MIT"
] | 26 | 2017-08-02T19:58:06.000Z | 2021-11-03T06:31:01.000Z | semibandits/plotting_script.py | akshaykr/oracle_cb | 68f10fce5eca8ebe3f57fd5a56a0ef8d82537ab4 | [
"MIT"
] | 1 | 2020-03-03T06:06:32.000Z | 2020-03-03T06:06:32.000Z | semibandits/plotting_script.py | akshaykr/oracle_cb | 68f10fce5eca8ebe3f57fd5a56a0ef8d82537ab4 | [
"MIT"
] | 10 | 2017-06-02T19:34:38.000Z | 2022-03-22T10:38:51.000Z | import matplotlib.pyplot as plt
import matplotlib.patches
import matplotlib as mpl
import numpy as np
import sys, argparse
sys.path.append("../")
import Plotting
Names = {
'mini_gb2': 'VC-GB2',
'mini_gb5': 'VC-GB5',
'mini_lin': 'VC-Lin',
'epsall_gb2': '$\epsilon$-GB2',
'epsall_gb5': '$\epsilon$-... | 33.331395 | 162 | 0.593581 | import pickle
import matplotlib.pyplot as plt
import matplotlib.patches
import matplotlib as mpl
import numpy as np
import sys, argparse
sys.path.append("../")
import Plotting
Names = {
'mini_gb2': 'VC-GB2',
'mini_gb5': 'VC-GB5',
'mini_lin': 'VC-Lin',
'epsall_gb2': '$\epsilon$-GB2',
'epsall_gb5'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 22 |
010b5e0043bc5876ab1a0b032ec3c37d63f3d2ba | 3,697 | py | Python | pacmill/filtering/mothur_uchime.py | xapple/pacmill | 1fde2316968251eaaf72618fd3d104ba524d6d12 | [
"MIT"
] | null | null | null | pacmill/filtering/mothur_uchime.py | xapple/pacmill | 1fde2316968251eaaf72618fd3d104ba524d6d12 | [
"MIT"
] | null | null | null | pacmill/filtering/mothur_uchime.py | xapple/pacmill | 1fde2316968251eaaf72618fd3d104ba524d6d12 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written by Lucas Sinclair.
MIT Licensed.
Contact at www.sinclair.bio
"""
# Built-in modules #
# First party modules #
# Third party modules #
###############################################################################
#########################################... | 34.231481 | 86 | 0.54693 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written by Lucas Sinclair.
MIT Licensed.
Contact at www.sinclair.bio
"""
# Built-in modules #
import os
# First party modules #
from fasta import FASTQ
from plumbing.check_cmd_found import check_cmd
from plumbing.cache import property_cached
from autopaths... | 0 | 281 | 0 | 2,805 | 0 | 0 | 0 | 77 | 176 |
098723ab33dce0dbfff39bd8321132e24734ccf0 | 6,980 | py | Python | olypy/oio.py | akhand2222/olypy | d2b62a590c416a7d919e6e7bfcabf35873bc13c4 | [
"Apache-2.0"
] | null | null | null | olypy/oio.py | akhand2222/olypy | d2b62a590c416a7d919e6e7bfcabf35873bc13c4 | [
"Apache-2.0"
] | null | null | null | olypy/oio.py | akhand2222/olypy | d2b62a590c416a7d919e6e7bfcabf35873bc13c4 | [
"Apache-2.0"
] | null | null | null | '''
Read and write Olympia state files.
'''
import os
import os.path
import sys
from .formatters import print_one_thing, read_oly_file
def fixup_ms(data):
'''
For whatever reason, the value in IM/ms needs to have a trailing space
'''
for box in data:
if 'IM' in data[box]:
if 'ms' ... | 30.21645 | 96 | 0.559312 | '''
Read and write Olympia state files.
'''
import os
import os.path
import sys
from contextlib import redirect_stdout
from .oid import to_oid
from .formatters import print_one_thing, read_oly_file
def fixup_ms(data):
'''
For whatever reason, the value in IM/ms needs to have a trailing space
'''
for... | 0 | 0 | 0 | 0 | 0 | 5,459 | 0 | 19 | 160 |
4ec1d714cb3bf6af4fe8c713411aefe484a53f23 | 589 | py | Python | flat/announce/migrations/0002_auto_20150916_0830.py | bilbeyt/ITURO-Giant_Flat | 5a3f766ab1394cefd3589a30c07b5a68b48be00e | [
"MIT"
] | null | null | null | flat/announce/migrations/0002_auto_20150916_0830.py | bilbeyt/ITURO-Giant_Flat | 5a3f766ab1394cefd3589a30c07b5a68b48be00e | [
"MIT"
] | null | null | null | flat/announce/migrations/0002_auto_20150916_0830.py | bilbeyt/ITURO-Giant_Flat | 5a3f766ab1394cefd3589a30c07b5a68b48be00e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 22.653846 | 62 | 0.575552 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('announce', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='announce',
old_name... | 0 | 0 | 0 | 459 | 0 | 0 | 0 | 19 | 46 |
b8458625ce4634483d199c8fcd5007dd84bf4c6b | 2,097 | py | Python | CondTools/L1Trigger/python/L1ConfigTSCPayloads_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CondTools/L1Trigger/python/L1ConfigTSCPayloads_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CondTools/L1Trigger/python/L1ConfigTSCPayloads_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | #from L1TriggerConfig.CSCTFConfigProducers.CSCTFAlignmentOnline_cfi import *
L1MuGMTParametersOnlineProducer.ignoreVersionMismatch = True
| 59.914286 | 84 | 0.904149 | from L1TriggerConfig.CSCTFConfigProducers.CSCTFConfigOnline_cfi import *
#from L1TriggerConfig.CSCTFConfigProducers.CSCTFAlignmentOnline_cfi import *
from L1TriggerConfig.CSCTFConfigProducers.L1MuCSCPtLutConfigOnline_cfi import *
from L1TriggerConfig.DTTrackFinder.L1MuDTEtaPatternLutOnline_cfi import *
from L1TriggerC... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,381 | 578 |
9215d936336e65cb6f3b980e5620414869829e05 | 354 | py | Python | orchard/system_status/__init__.py | BMeu/Orchard | cd595c9942e4e1ad0032193059f2b39fdf3bcfba | [
"MIT"
] | 2 | 2016-10-06T21:19:32.000Z | 2016-10-06T21:58:04.000Z | orchard/system_status/__init__.py | BMeu/Orchard | cd595c9942e4e1ad0032193059f2b39fdf3bcfba | [
"MIT"
] | 392 | 2016-10-06T17:13:30.000Z | 2021-01-15T04:15:38.000Z | orchard/system_status/__init__.py | BMeu/Orchard | cd595c9942e4e1ad0032193059f2b39fdf3bcfba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This package includes the Flask blueprint and all related functionality for displaying system
information.
"""
from .blueprint import blueprint
from .status_item import StatusItem
from .status_group import StatusGroup
__all__ = ['blueprint', 'StatusGroup', 'StatusItem']
| 23.6 | 97 | 0.751412 | # -*- coding: utf-8 -*-
"""
This package includes the Flask blueprint and all related functionality for displaying system
information.
"""
from .blueprint import blueprint
from .status_item import StatusItem
from .status_group import StatusGroup
import orchard.system_status.views # NOQA
__all__ = ['bluepri... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 31 |
e1f06e37830afaf38b03d65459b500198005e166 | 1,290 | py | Python | PP4E/Examples/PP4E/Integrate/Embed/prioredition-2x/Inventory/validate1.py | BeacherHou/Python-_Markdown- | 015d79a02d32f49395b80ca10919b3a09b72c4df | [
"MIT"
] | null | null | null | PP4E/Examples/PP4E/Integrate/Embed/prioredition-2x/Inventory/validate1.py | BeacherHou/Python-_Markdown- | 015d79a02d32f49395b80ca10919b3a09b72c4df | [
"MIT"
] | null | null | null | PP4E/Examples/PP4E/Integrate/Embed/prioredition-2x/Inventory/validate1.py | BeacherHou/Python-_Markdown- | 015d79a02d32f49395b80ca10919b3a09b72c4df | [
"MIT"
] | null | null | null | # embedded validation code, run from C
# input vars: PRODUCT, QUANTITY, BUYER
# output vars: ERRORS, WARNINGS
import string # all python tools are available to embedded code
import inventory # plus C extensions, Python modules, classes,..
msgs, errs = [], [] # warning, error messag... | 43 | 79 | 0.624031 | # embedded validation code, run from C
# input vars: PRODUCT, QUANTITY, BUYER
# output vars: ERRORS, WARNINGS
import string # all python tools are available to embedded code
import inventory # plus C extensions, Python modules, classes,..
msgs, errs = [], [] # warning, error messag... | 0 | 0 | 0 | 0 | 0 | 408 | 0 | 0 | 25 |