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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c62e471845b93de70871f48bb391224564e10b9d | 2,537 | py | Python | morgana/Examples/python_example_scripts/old_version/02_create_ground_truth.py | Nikoula86/organoidSegment | b5d00256c15302ccd76b8b7a412852750476504b | [
"MIT"
] | 8 | 2021-09-08T10:49:53.000Z | 2022-02-25T13:28:03.000Z | morgana/Examples/python_example_scripts/old_version/02_create_ground_truth.py | Nikoula86/organoidSegment | b5d00256c15302ccd76b8b7a412852750476504b | [
"MIT"
] | null | null | null | morgana/Examples/python_example_scripts/old_version/02_create_ground_truth.py | Nikoula86/organoidSegment | b5d00256c15302ccd76b8b7a412852750476504b | [
"MIT"
] | 1 | 2021-11-24T08:10:41.000Z | 2021-11-24T08:10:41.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 24 12:26:12 2020
@author: gritti
"""
import tqdm
import os
# import sys
# sys.path.append(os.path.join('..'))
###############################################################################
model_folders = [
os.path.join('test_data','2020-09-22_co... | 34.283784 | 162 | 0.587308 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 24 12:26:12 2020
@author: gritti
"""
import tqdm
import os
# import sys
# sys.path.append(os.path.join('..'))
from orgseg.GUIs.manualmask import makeManualMask
from orgseg.DatasetTools import io
#########################################################################... | 0 | 0 | 0 | 0 | 0 | 1,673 | 0 | 41 | 67 |
21a8ff372a94dc4b17ebbcb16fdf9c8a605c4286 | 1,141 | py | Python | archive/gdax-bitcoin.py | buraktokman/Crypto-Exchange-Data-Fetcher | 23e6ba542ff7a862af3247db2c04c2c10a5f3edf | [
"MIT"
] | 1 | 2021-08-09T07:22:25.000Z | 2021-08-09T07:22:25.000Z | archive/gdax-bitcoin.py | buraktokman/Crypto-Exchange-Data-Fetcher | 23e6ba542ff7a862af3247db2c04c2c10a5f3edf | [
"MIT"
] | null | null | null | archive/gdax-bitcoin.py | buraktokman/Crypto-Exchange-Data-Fetcher | 23e6ba542ff7a862af3247db2c04c2c10a5f3edf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import datetime, time
from pathlib import Path
csv_file = Path(__file__).parents[0] / 'data' / 'gdax-bitcoin.csv'
if __name__ == '__main__':
while True:
now = datetime.datetime.now()
while (now.second % 5):
now = datetime.datetime.now()
print(now.seco... | 28.525 | 87 | 0.617003 | #!/usr/bin/env python3
import urllib.request, json, datetime, time
from urllib.request import urlopen
from pathlib import Path
csv_file = Path(__file__).parents[0] / 'data' / 'gdax-bitcoin.csv'
def request(url):
with urllib.request.urlopen(url) as url:
data = json.loads(url.read().decode())
print(data... | 0 | 0 | 0 | 0 | 0 | 672 | 0 | 35 | 68 |
36b92bb1526f3a9da7363ca52f98832014813eaf | 93 | py | Python | codes_auto/251.flatten-2d-vector.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | codes_auto/251.flatten-2d-vector.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | codes_auto/251.flatten-2d-vector.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=251 lang=python3
#
# [251] flatten-2d-vector
#
None
# @lc code=end | 13.285714 | 41 | 0.666667 | #
# @lc app=leetcode.cn id=251 lang=python3
#
# [251] flatten-2d-vector
#
None
# @lc code=end | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
58ca5ff75d44f47faac66456474cd35e0f1c0fdb | 1,796 | py | Python | addons/calendar/models/mail_activity.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/calendar/models/mail_activity.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/calendar/models/mail_activity.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
| 39.043478 | 119 | 0.654788 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models, fields, tools, _
class MailActivityType(models.Model):
_inherit = "mail.activity.type"
category = fields.Selection(selection_add=[('meeting', 'Meeting')])
class MailActivity(mod... | 0 | 0 | 0 | 1,601 | 0 | 0 | 0 | 25 | 69 |
75bc9f1808d3923afaf6c3b89c04c2116d84a380 | 767 | py | Python | AoC2021/6/main.py | SCBbestof/AoC | 861f0b43e2c8d1b8580dbf53aa7bd5556c7c75ad | [
"MIT"
] | null | null | null | AoC2021/6/main.py | SCBbestof/AoC | 861f0b43e2c8d1b8580dbf53aa7bd5556c7c75ad | [
"MIT"
] | null | null | null | AoC2021/6/main.py | SCBbestof/AoC | 861f0b43e2c8d1b8580dbf53aa7bd5556c7c75ad | [
"MIT"
] | null | null | null | with open("data.in") as file:
lines = file.readlines()
lines = [line.rstrip() for line in lines]
lines = lines[0].split(",")
arr = []
for ln in lines:
arr.append(int(ln))
for i in range(80):
for j in range(0, len(arr)):
if arr[j] <= 0:
arr[j] = 6
... | 23.242424 | 45 | 0.482399 | with open("data.in") as file:
lines = file.readlines()
lines = [line.rstrip() for line in lines]
lines = lines[0].split(",")
arr = []
for ln in lines:
arr.append(int(ln))
for i in range(80):
for j in range(0, len(arr)):
if arr[j] <= 0:
arr[j] = 6
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a747fcf6a611afaccd0b841157ac9e2dbef3c8e2 | 1,403 | py | Python | chrome/test/enterprise/e2e/policy/password_manager_enabled/password_manager_enabled.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chrome/test/enterprise/e2e/policy/password_manager_enabled/password_manager_enabled.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chrome/test/enterprise/e2e/policy/password_manager_enabled/password_manager_enabled.py | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
| 32.627907 | 96 | 0.75196 | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
from chrome_ent_test.infra.core import environment, before_all, test
from infra import ChromeEnterpriseTestCase
@environment(file="../policy_test... | 0 | 1,094 | 0 | 0 | 0 | 0 | 0 | 56 | 90 |
9a71ea4cabd3ecdbaad8ef400436428f59cd7dd3 | 10,921 | py | Python | source/learning/model.py | OmarSayedMostafa/pytorch-upper-Maxilla-and-lower-Mandible-jaws-segmentation | 0ed1da5d364f0dbac72d1b3636d0da0abac19e4d | [
"RSA-MD"
] | 1 | 2022-03-19T11:02:28.000Z | 2022-03-19T11:02:28.000Z | source/learning/model.py | OmarSayedMostafa/pytorch-upper-Maxilla-and-lower-Mandible-jaws-segmentation | 0ed1da5d364f0dbac72d1b3636d0da0abac19e4d | [
"RSA-MD"
] | null | null | null | source/learning/model.py | OmarSayedMostafa/pytorch-upper-Maxilla-and-lower-Mandible-jaws-segmentation | 0ed1da5d364f0dbac72d1b3636d0da0abac19e4d | [
"RSA-MD"
] | null | null | null | import torch.nn as nn
__all__ = ["DeepLabV3"]
| 34.560127 | 122 | 0.589232 | import torch
import torch.nn.functional as F
import torch.nn as nn
from collections import OrderedDict
class UNet(nn.Module):
def __init__(self, n_classes_input, n_classes_output, batchnorm = False, dropout_p=0.0):
super(UNet, self).__init__()
self.inc = inconv(n_classes_input, 64, batchnorm)
... | 0 | 0 | 0 | 9,253 | 0 | 1,135 | 0 | 15 | 461 |
3db3d36bceb49d0c9b8c6d1f75a9539136a2a20f | 7,260 | py | Python | app/recipe/views.py | igndukwe/recipe-app-api | 8b0554e7d15fdab8c0aa99e7b3dcb56187998ceb | [
"MIT"
] | null | null | null | app/recipe/views.py | igndukwe/recipe-app-api | 8b0554e7d15fdab8c0aa99e7b3dcb56187998ceb | [
"MIT"
] | null | null | null | app/recipe/views.py | igndukwe/recipe-app-api | 8b0554e7d15fdab8c0aa99e7b3dcb56187998ceb | [
"MIT"
] | null | null | null |
# We are goint to be creating a viewset
# and basing it of the combination of generic viewset
# and we are specifically going to use the list model mixins
# > A django rest frameworke feature
# where you can pull in different parts of a viewset
# that we want to use for our application
# > so we only want to take... | 38.210526 | 77 | 0.674656 |
# We are goint to be creating a viewset
# and basing it of the combination of generic viewset
# and we are specifically going to use the list model mixins
# > A django rest frameworke feature
# where you can pull in different parts of a viewset
# that we want to use for our application
# > so we only want to take... | 0 | 736 | 0 | 5,486 | 0 | 0 | 0 | 184 | 245 |
e81b68ba6d2033055b7933b11730c205a1112d28 | 4,024 | py | Python | custom_components/xiaomi_miot_raw/deps/const.py | Daneaz/xiaomi_miot_raw | 987a5eac8741b6bd2c82b846978ba0a12a667886 | [
"Apache-2.0"
] | null | null | null | custom_components/xiaomi_miot_raw/deps/const.py | Daneaz/xiaomi_miot_raw | 987a5eac8741b6bd2c82b846978ba0a12a667886 | [
"Apache-2.0"
] | null | null | null | custom_components/xiaomi_miot_raw/deps/const.py | Daneaz/xiaomi_miot_raw | 987a5eac8741b6bd2c82b846978ba0a12a667886 | [
"Apache-2.0"
] | null | null | null | import homeassistant.helpers.config_validation as cv
import voluptuous as vol
CONF_UPDATE_INSTANT = "update_instant"
CONF_MAPPING = 'mapping'
CONF_CONTROL_PARAMS = 'params'
CONF_CLOUD = 'update_from_cloud'
CONF_MODEL = 'model'
CONF_SENSOR_PROPERTY = "sensor_property"
CONF_SENSOR_UNIT = "sensor_unit"
CONF_DEFAULT_PROPE... | 27.189189 | 81 | 0.492296 | import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.const import *
CONF_UPDATE_INSTANT = "update_instant"
CONF_MAPPING = 'mapping'
CONF_CONTROL_PARAMS = 'params'
CONF_CLOUD = 'update_from_cloud'
CONF_MODEL = 'model'
CONF_SENSOR_PROPERTY = "sensor_property"
CONF_SENSOR_UNIT ... | 168 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 22 |
bec1a1e105bd7e36d63830d345623c40085e6acf | 25,240 | py | Python | PythonNetwork/venv/Lib/site-packages/google/protobuf/type_pb2.py | Moldovandreii/RepetitionCount | b5715b0948b609fde0ce05d45023b7d4cfd635e7 | [
"FTL"
] | 1,894 | 2015-04-17T18:29:53.000Z | 2022-03-28T22:41:06.000Z | PythonNetwork/venv/Lib/site-packages/google/protobuf/type_pb2.py | Moldovandreii/RepetitionCount | b5715b0948b609fde0ce05d45023b7d4cfd635e7 | [
"FTL"
] | 4,640 | 2015-07-08T16:19:08.000Z | 2019-12-02T15:01:27.000Z | PythonNetwork/venv/Lib/site-packages/google/protobuf/type_pb2.py | Moldovandreii/RepetitionCount | b5715b0948b609fde0ce05d45023b7d4cfd635e7 | [
"FTL"
] | 698 | 2015-06-02T19:18:35.000Z | 2022-03-29T16:57:15.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/type.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from ... | 43.972125 | 2,740 | 0.750238 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/type.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2f420971607e641370ba1d5ce2d4ac918e1560c6 | 251 | py | Python | tests/common/constants.py | infoshareacademy/jpydzr1-dkmap-django | 4fc34b2d721507b69a7fe945fd4ea3e5fd863828 | [
"MIT"
] | null | null | null | tests/common/constants.py | infoshareacademy/jpydzr1-dkmap-django | 4fc34b2d721507b69a7fe945fd4ea3e5fd863828 | [
"MIT"
] | 1 | 2021-03-20T18:56:37.000Z | 2021-03-20T18:56:37.000Z | tests/common/constants.py | infoshareacademy/jpydzr1-dkmap-django | 4fc34b2d721507b69a7fe945fd4ea3e5fd863828 | [
"MIT"
] | null | null | null | BOARD_FIELDS_EXPECTED = {
'first_field': 0,
'second_field': 1,
'third_field': 2,
'fourth_field': 3,
'fifth_field': 4,
'sixth_field': 5,
'seventh_field': 6,
'eighth_field': 7,
'ninth_field': 8
}
FIELD_EMPTY_VAL = " " | 20.916667 | 25 | 0.593625 | BOARD_FIELDS_EXPECTED = {
'first_field': 0,
'second_field': 1,
'third_field': 2,
'fourth_field': 3,
'fifth_field': 4,
'sixth_field': 5,
'seventh_field': 6,
'eighth_field': 7,
'ninth_field': 8
}
FIELD_EMPTY_VAL = " " | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7db3c1dd01c161f35a0206bbf5386c1a5f7c8e4d | 846 | py | Python | hata/ext/rpc/exceptions.py | Multiface24111/hata | cd28f9ef158e347363669cc8d1d49db0ff41aba0 | [
"0BSD"
] | 173 | 2019-06-14T20:25:00.000Z | 2022-03-21T19:36:10.000Z | hata/ext/rpc/exceptions.py | Multiface24111/hata | cd28f9ef158e347363669cc8d1d49db0ff41aba0 | [
"0BSD"
] | 52 | 2020-01-03T17:05:14.000Z | 2022-03-31T11:39:50.000Z | hata/ext/rpc/exceptions.py | Multiface24111/hata | cd28f9ef158e347363669cc8d1d49db0ff41aba0 | [
"0BSD"
] | 47 | 2019-11-09T08:46:45.000Z | 2022-03-31T14:33:34.000Z | __all__ = ('DiscordRPCError', )
| 25.636364 | 75 | 0.542553 | __all__ = ('DiscordRPCError', )
class DiscordRPCError(BaseException):
"""
Discord RPC error code.
Attributes
----------
code : `int`
Discord RPC error code.
message : `str`
Discord RPC error message.
"""
def __init__(self, code, message):
"""
Creates... | 0 | 0 | 0 | 791 | 0 | 0 | 0 | 0 | 23 |
d0ad443fa2d28e25f90e7079ee64526fe2255f0b | 1,166 | py | Python | Basic_IO/count_numbers.py | shubee17/HackerEarth | 73cc17a64490969cc6b9648601e7a9d817e7dfd1 | [
"MIT"
] | null | null | null | Basic_IO/count_numbers.py | shubee17/HackerEarth | 73cc17a64490969cc6b9648601e7a9d817e7dfd1 | [
"MIT"
] | null | null | null | Basic_IO/count_numbers.py | shubee17/HackerEarth | 73cc17a64490969cc6b9648601e7a9d817e7dfd1 | [
"MIT"
] | null | null | null | """
Your task is pretty simple , given a string S , find the total count of numbers present in the digit.
Input
The first line contains T , the number of test cases. The first line of each and every testc ase will contain a integer N , the length of the string . The second line of each and every test case will contai... | 22.862745 | 231 | 0.627787 | """
Your task is pretty simple , given a string S , find the total count of numbers present in the digit.
Input
The first line contains T , the number of test cases. The first line of each and every testc ase will contain a integer N , the length of the string . The second line of each and every test case will contai... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d0ea79d7ce1f551c9b67e6805b22a9073c3ae0c7 | 7,869 | py | Python | dcc_venv/venvs_handler.py | rBrenick/dcc-venv | c199fadd3c1b8d58b818becf45f4638c2bdc9a7f | [
"MIT"
] | 4 | 2019-06-06T21:57:42.000Z | 2021-09-13T14:11:35.000Z | dcc_venv/venvs_handler.py | rBrenick/dcc-venv | c199fadd3c1b8d58b818becf45f4638c2bdc9a7f | [
"MIT"
] | null | null | null | dcc_venv/venvs_handler.py | rBrenick/dcc-venv | c199fadd3c1b8d58b818becf45f4638c2bdc9a7f | [
"MIT"
] | 1 | 2020-12-06T18:14:05.000Z | 2020-12-06T18:14:05.000Z | import os
import sys
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(" dcc-venv ")
# VENV_ROOT_FOLDER = os.path.join(os.path.expanduser('~'), ".dcc-venvs")
VENV_ROOT_FOLDER = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))), ".venvs")
CONFIGS_FOLDER = os.path.ab... | 29.806818 | 112 | 0.607955 | import os
import sys
import imp
import venv
import shutil
import stat
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(" dcc-venv ")
import requirements_handler as reqhand
# VENV_ROOT_FOLDER = os.path.join(os.path.expanduser('~'), ".dcc-venvs")
VENV_ROOT_FOLDER = os.path.join(os.path.a... | 0 | 0 | 0 | 0 | 0 | 5,404 | 0 | -22 | 280 |
359220406527a1281d48494104b818ce6350a538 | 589 | py | Python | basic_lambda_function.py | radii/lambda-apigateway-twilio-tutorial | d2c990dbe5ca870e50243ae50e208dfd1889ddef | [
"Apache-2.0"
] | 104 | 2015-12-14T21:46:40.000Z | 2018-01-31T19:52:11.000Z | basic_lambda_function.py | radii/lambda-apigateway-twilio-tutorial | d2c990dbe5ca870e50243ae50e208dfd1889ddef | [
"Apache-2.0"
] | 4 | 2016-01-11T15:07:03.000Z | 2017-05-07T08:38:50.000Z | basic_lambda_function.py | radii/lambda-apigateway-twilio-tutorial | d2c990dbe5ca870e50243ae50e208dfd1889ddef | [
"Apache-2.0"
] | 37 | 2015-12-19T21:56:03.000Z | 2017-12-19T15:42:46.000Z | '''
Basic Twilio handler function
'''
import boto3
from boto3.session import Session
# create an S3 & Dynamo session
s3 = boto3.resource('s3')
session = Session()
| 19.633333 | 65 | 0.680815 | '''
Basic Twilio handler function
'''
import boto3
import random
import StringIO
import urllib2
from boto3.dynamodb.conditions import Key
from boto3.session import Session
# create an S3 & Dynamo session
s3 = boto3.resource('s3')
session = Session()
def lambda_handler(event, context):
message = event['body']
... | 0 | 0 | 0 | 0 | 0 | 313 | 0 | -1 | 112 |
c27b28f0950517aebb8aa8a605d825cf8e6e5a75 | 1,326 | py | Python | setup.py | aaronlelevier/mlearning | 92e60d89f18151e07bcd1931fbd956019a233ef5 | [
"MIT"
] | 3 | 2020-01-16T10:11:09.000Z | 2021-01-20T12:59:21.000Z | setup.py | aaronlelevier/mlearning | 92e60d89f18151e07bcd1931fbd956019a233ef5 | [
"MIT"
] | 1 | 2020-01-12T11:16:48.000Z | 2020-01-12T11:16:48.000Z | setup.py | aaronlelevier/mlearning | 92e60d89f18151e07bcd1931fbd956019a233ef5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
from setuptools import find_packages, setup
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(package, '__init__.py')).read()
return re.search("__version__... | 27.625 | 121 | 0.621418 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
from setuptools import find_packages, setup
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(package, '__init__.py')).read()
return re.search("__version__... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
10199d5a643f3bff67cbb00da10669245dae054e | 735 | py | Python | test/test_ber.py | graille/ITR315-deep-telecom | 13d67e5bfc3659f69e72bde6761cca8b0420b44a | [
"MIT"
] | null | null | null | test/test_ber.py | graille/ITR315-deep-telecom | 13d67e5bfc3659f69e72bde6761cca8b0420b44a | [
"MIT"
] | null | null | null | test/test_ber.py | graille/ITR315-deep-telecom | 13d67e5bfc3659f69e72bde6761cca8b0420b44a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
from src.communications import Transmitter, AWGNChannel, Receiver
# Configuration
MODULATION = 'BPSK'
EbN0dBs = np.linspace(-20, 8, 20)
# Initialization
transmitter = Transmitter(MODULATION)
receiver = Receiver(MODULATION)
channel = AWGNChan... | 24.5 | 100 | 0.707483 | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
from src.communications import Transmitter, AWGNChannel, Receiver
from src.utils import *
# Configuration
MODULATION = 'BPSK'
EbN0dBs = np.linspace(-20, 8, 20)
# Initialization
transmitter = Transmitter(MODULATION)
receiver = Receiver(MODULAT... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 22 |
97af0d4270e7125ce486b5ebce2f379147e6d92d | 1,177 | py | Python | SoundEffect.py | dan-kuroto/HarukaPet | 09409ec254530b53624c431cd9b4add612bfa2fc | [
"MIT"
] | 4 | 2022-01-27T15:51:33.000Z | 2022-03-28T07:20:05.000Z | SoundEffect.py | dan-kuroto/HarukaPet | 09409ec254530b53624c431cd9b4add612bfa2fc | [
"MIT"
] | null | null | null | SoundEffect.py | dan-kuroto/HarukaPet | 09409ec254530b53624c431cd9b4add612bfa2fc | [
"MIT"
] | null | null | null | import sys
from PyQt5.QtWidgets import QApplication
voicePlayer = Sound('voice') #
soundPlayer = Sound('sound') #
# bgmPlayer = Sound('bgm') # BGM
if __name__ == '__main__': #
# .position().duration()
from time import sleep
app = QApplication(sys.argv)
sound = Sound('test')
sound.play_m... | 28.707317 | 64 | 0.64486 | import json
import sys
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication
from PyQt5.QtMultimedia import QMediaContent, QMediaPlayer
class Sound(QMediaPlayer):
def __init__(self, name: str):
super(Sound, self).__init__()
self.setObjectName(name)
def play_music(self, path: ... | 321 | 0 | 0 | 502 | 0 | 0 | 0 | 35 | 89 |
605f35d964149765b20bfddb755148266f5ebefa | 4,059 | py | Python | gen/gen.py | JBorrow/GoGoGadget | 9eb0384aba585d181a43a474c951ca9071864d14 | [
"MIT"
] | null | null | null | gen/gen.py | JBorrow/GoGoGadget | 9eb0384aba585d181a43a474c951ca9071864d14 | [
"MIT"
] | null | null | null | gen/gen.py | JBorrow/GoGoGadget | 9eb0384aba585d181a43a474c951ca9071864d14 | [
"MIT"
] | null | null | null | import gen.dists as dists
if __name__ == "__main__":
# Generate some test distribution and display in 3d with mpl
gen = Generator(int(100), int(100), int(100), 1e5, 1e4, 10, 40, 100, 10, 40, 100, 10, 2)
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')... | 34.991379 | 141 | 0.635378 | import numpy as np
import gen.dists as dists
class Generator:
def __init__(self, n_DM, n_gas, n_star, M_halo, M_gas, M_star, R_NFW, c_NFW, R_gas, max_gas, Z_gas, R_star, max_star, Z_star, G=6.67e-8):
self.n_DM = n_DM
self.n_gas = n_gas
self.n_star = n_star
self.M_halo = M_halo
... | 0 | 0 | 0 | 3,408 | 0 | 0 | 0 | 15 | 72 |
e5cf921f51dc8aeb84813b308b2172c05c4d3efd | 2,599 | py | Python | SRC/engine/IO/meshinfo.py | usnistgov/OOF3D | 4fd423a48aea9c5dc207520f02de53ae184be74c | [
"X11"
] | 31 | 2015-04-01T15:59:36.000Z | 2022-03-18T20:21:47.000Z | SRC/engine/IO/meshinfo.py | usnistgov/OOF3D | 4fd423a48aea9c5dc207520f02de53ae184be74c | [
"X11"
] | 3 | 2015-02-06T19:30:24.000Z | 2017-05-25T14:14:31.000Z | SRC/engine/IO/meshinfo.py | usnistgov/OOF3D | 4fd423a48aea9c5dc207520f02de53ae184be74c | [
"X11"
] | 7 | 2015-01-23T15:19:22.000Z | 2021-06-09T09:03:59.000Z | # -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... | 39.378788 | 72 | 0.698346 | # -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... | 0 | 0 | 0 | 1,814 | 0 | 0 | 0 | 36 | 137 |
966b50a9e7312243d16b4738bb05893c48473875 | 211 | py | Python | Chapter 4/pair_client.py | PacktPublishing/Mastering-IPython-4 | d752f7ba38e0c9399a83d57da406fe26152f272b | [
"MIT"
] | 22 | 2016-06-07T07:52:35.000Z | 2021-11-08T13:12:21.000Z | Chapter 4/pair_client.py | PacktPublishing/Mastering-IPython-4 | d752f7ba38e0c9399a83d57da406fe26152f272b | [
"MIT"
] | 2 | 2016-05-23T08:20:54.000Z | 2018-07-02T08:21:32.000Z | Chapter 4/pair_client.py | PacktPublishing/Mastering-IPython-4 | d752f7ba38e0c9399a83d57da406fe26152f272b | [
"MIT"
] | 27 | 2016-05-23T08:19:51.000Z | 2021-08-31T02:46:00.000Z | import zmq
context = zmq.Context()
socket = context.socket(zmq.PAIR)
socket.bind("tcp://*:5555" % port)
while True:
socket.send("What time is it?")
msg = socket.recv()
print msg
time.sleep(1)
| 16.230769 | 35 | 0.63981 | import zmq
context = zmq.Context()
socket = context.socket(zmq.PAIR)
socket.bind("tcp://*:5555" % port)
while True:
socket.send("What time is it?")
msg = socket.recv()
print msg
time.sleep(1)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
edbd3df8bb3402a06e9354c51cce1d5a2e698ae0 | 396 | py | Python | djangoapp/website/admin_urls.py | jaysridhar/fuzzy-spoon | 43ff6c424c6fe8e0d46cbb1555ada57957bf0cb4 | [
"MIT"
] | null | null | null | djangoapp/website/admin_urls.py | jaysridhar/fuzzy-spoon | 43ff6c424c6fe8e0d46cbb1555ada57957bf0cb4 | [
"MIT"
] | null | null | null | djangoapp/website/admin_urls.py | jaysridhar/fuzzy-spoon | 43ff6c424c6fe8e0d46cbb1555ada57957bf0cb4 | [
"MIT"
] | null | null | null | from django.urls import path
from website import api
urlpatterns = [
path('', api.load_user_location),
path('status/<status>', api.load_user_location),
path('approve/<locid>', api.approve_user_location),
path('approve/', api.approve_user_location),
path('disapprove/<locid>', api.disapprove_... | 33 | 62 | 0.704545 | from django.urls import path
from website import api
urlpatterns = [
path('', api.load_user_location),
path('status/<status>', api.load_user_location),
path('approve/<locid>', api.approve_user_location),
path('approve/', api.approve_user_location),
path('disapprove/<locid>', api.disapprove_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e290af2c95b86f602dda1aefef693139350755aa | 2,928 | py | Python | tests.py | ardinor/mojibake | b080656866603ebf4020ea2b49618cc29533a77b | [
"MIT"
] | 1 | 2015-11-05T16:14:13.000Z | 2015-11-05T16:14:13.000Z | tests.py | ardinor/mojibake | b080656866603ebf4020ea2b49618cc29533a77b | [
"MIT"
] | null | null | null | tests.py | ardinor/mojibake | b080656866603ebf4020ea2b49618cc29533a77b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
#TO DO: More work on this on testing!
#http://flask.pocoo.org/docs/testing/
if __name__ == '__main__':
unittest.main()
| 32.533333 | 96 | 0.644467 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import datetime
from sqlalchemy.exc import IntegrityError
from mojibake.app import app, db
from mojibake.models import Post, Category, Tag, User
from mojibake.settings import TEST_DATABASE_URI
#TO DO: More work on this on testing!
#http://flask.pocoo.org/... | 123 | 0 | 0 | 2,480 | 0 | 0 | 0 | 83 | 134 |
b52bff6ffbcd793210d4dcce63d859de14a6987e | 12,658 | py | Python | functions/ScheduleMaintenanceWindow/ScheduleMaintenanceWindow.py | densify-quick-start/ITSM-Controlled-Continuous-Optimization | bd05c4bb705c6412cc62a0cc597f39dbd96c7e60 | [
"Apache-2.0"
] | 1 | 2021-05-20T22:50:52.000Z | 2021-05-20T22:50:52.000Z | functions/ScheduleMaintenanceWindow/ScheduleMaintenanceWindow.py | densify-quick-start/ITSM-Controlled-Continuous-Optimization | bd05c4bb705c6412cc62a0cc597f39dbd96c7e60 | [
"Apache-2.0"
] | null | null | null | functions/ScheduleMaintenanceWindow/ScheduleMaintenanceWindow.py | densify-quick-start/ITSM-Controlled-Continuous-Optimization | bd05c4bb705c6412cc62a0cc597f39dbd96c7e60 | [
"Apache-2.0"
] | 1 | 2021-05-26T11:56:06.000Z | 2021-05-26T11:56:06.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 17 10:42:50 2020
@author: draveendran
"""
#SSM Functions | 28.638009 | 196 | 0.539027 | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 17 10:42:50 2020
@author: draveendran
"""
import json
import boto3
import datetime
import os
def lambda_handler(event, context):
# TODO implement
try:
print("Incoming event: " + str(event))
if int(event['duration']) < 1 or int(even... | 0 | 0 | 0 | 0 | 0 | 12,165 | 0 | -37 | 421 |
1f26b6eb6d6dcadfa381edb1a417fab9d0a51f97 | 5,305 | py | Python | python_graphs/instruction_test.py | reshinthadithyan/python-graphs | 1234c448cb38af44c963d5ef7f8d99f678028104 | [
"Apache-2.0"
] | 53 | 2021-04-12T14:20:16.000Z | 2022-03-29T02:47:30.000Z | python_graphs/instruction_test.py | reshinthadithyan/python-graphs | 1234c448cb38af44c963d5ef7f8d99f678028104 | [
"Apache-2.0"
] | 2 | 2021-09-08T16:37:34.000Z | 2022-03-15T17:32:36.000Z | python_graphs/instruction_test.py | reshinthadithyan/python-graphs | 1234c448cb38af44c963d5ef7f8d99f678028104 | [
"Apache-2.0"
] | 14 | 2021-05-08T04:34:46.000Z | 2022-01-16T12:58:16.000Z | # Copyright (C) 2021 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 42.782258 | 77 | 0.6541 | # Copyright (C) 2021 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 0 | 0 | 0 | 4,353 | 0 | 131 | 0 | 35 | 90 |
5033bba781caf73f73ae20dbf086ab6ddfb77ca5 | 38 | py | Python | Local/hello.py | JeffreyILipton/ME480 | 7271418cf396fd537e4393daa3106b21a1d55806 | [
"MIT"
] | 15 | 2019-10-07T21:09:25.000Z | 2021-11-01T21:07:37.000Z | Local/helloX.py | JeffreyILipton/ME480 | 7271418cf396fd537e4393daa3106b21a1d55806 | [
"MIT"
] | null | null | null | Local/helloX.py | JeffreyILipton/ME480 | 7271418cf396fd537e4393daa3106b21a1d55806 | [
"MIT"
] | 23 | 2019-10-07T21:09:32.000Z | 2021-12-10T09:30:33.000Z | #!/usr/bin/env python3
print('hello')
| 12.666667 | 22 | 0.684211 | #!/usr/bin/env python3
print('hello')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
92901e6c444bc5f4f8ae8d14f89d8eb5493b3596 | 2,614 | py | Python | preprocess.py | koshian2/ImageNet | ed11a31637db6f7c2df12232e3cb1cabad8397e9 | [
"MIT"
] | null | null | null | preprocess.py | koshian2/ImageNet | ed11a31637db6f7c2df12232e3cb1cabad8397e9 | [
"MIT"
] | null | null | null | preprocess.py | koshian2/ImageNet | ed11a31637db6f7c2df12232e3cb1cabad8397e9 | [
"MIT"
] | null | null | null | from PIL import Image, ImageOps
import numpy as np
def imagenet_data_augmentation(pillow_img, target_size,
area_min=0.08, area_max=1.0,
aspect_min=0.75, aspect_max=4.0/3.0):
"""
Data augmentation for single image(based on GoogLe Net)
# input : p... | 43.566667 | 91 | 0.677123 | from PIL import Image, ImageOps
import numpy as np
import matplotlib.pyplot as plt
def imagenet_data_augmentation(pillow_img, target_size,
area_min=0.08, area_max=1.0,
aspect_min=0.75, aspect_max=4.0/3.0):
"""
Data augmentation for single image(base... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 22 |
40007e4e513dfb447e6e296344187853d86b55e6 | 292 | py | Python | test/core/scripts/basicpass.py | jcollins1983/Fixate | 132f7cda69f3d53ff1bd660518d11b45dc6182fd | [
"MIT"
] | 15 | 2018-10-05T04:55:18.000Z | 2022-03-10T08:08:20.000Z | test/core/scripts/basicpass.py | jcollins1983/Fixate | 132f7cda69f3d53ff1bd660518d11b45dc6182fd | [
"MIT"
] | 86 | 2018-09-26T02:33:11.000Z | 2022-01-10T06:12:17.000Z | test/core/scripts/basicpass.py | jcollins1983/Fixate | 132f7cda69f3d53ff1bd660518d11b45dc6182fd | [
"MIT"
] | 12 | 2018-10-09T01:32:11.000Z | 2022-03-22T01:19:09.000Z |
__version__ = "1"
TEST_SEQUENCE = [SimpleTest()]
| 18.25 | 45 | 0.705479 | from fixate.core.common import TestClass
from fixate.core.ui import user_ok, user_info
from fixate.core.checks import *
__version__ = "1"
class SimpleTest(TestClass):
"""Simple passing test"""
def test(self):
chk_true(True, "It is True!")
TEST_SEQUENCE = [SimpleTest()]
| 0 | 0 | 0 | 96 | 0 | 0 | 0 | 54 | 89 |
d919e4aad227c8d885586066bf1525c3fd9f0dba | 120 | py | Python | src/exactcover/__init__.py | cliffordw20/exactcover | 0dc85d7a6e7da229ce0a0bbab086f2e54591dc5e | [
"MIT"
] | null | null | null | src/exactcover/__init__.py | cliffordw20/exactcover | 0dc85d7a6e7da229ce0a0bbab086f2e54591dc5e | [
"MIT"
] | null | null | null | src/exactcover/__init__.py | cliffordw20/exactcover | 0dc85d7a6e7da229ce0a0bbab086f2e54591dc5e | [
"MIT"
] | null | null | null | """Exactcover __init__."""
from .exactcover import solve, ExactCoverKeyError
__all__ = ['solve', 'ExactCoverKeyError']
| 24 | 49 | 0.758333 | """Exactcover __init__."""
from .exactcover import solve, ExactCoverKeyError
__all__ = ['solve', 'ExactCoverKeyError']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6bf5522636bdaf3a60c73c55d8011380e018549f | 8,761 | py | Python | global_var.py | NightFurySL2001/CJK-character-count | cee3fffb898b2080682218aad802080856b89a07 | [
"MIT"
] | 125 | 2020-07-14T06:30:01.000Z | 2022-03-27T06:48:34.000Z | global_var.py | NightFurySL2001/CJK-character-count | cee3fffb898b2080682218aad802080856b89a07 | [
"MIT"
] | 3 | 2021-06-25T01:42:27.000Z | 2022-02-06T14:34:55.000Z | global_var.py | NightFurySL2001/CJK-character-count | cee3fffb898b2080682218aad802080856b89a07 | [
"MIT"
] | 3 | 2021-01-17T03:08:03.000Z | 2022-02-17T08:42:22.000Z | global cjk_list
global unicode_list
global cjk_jian_list
global cjk_jian_fan_list
global cjk_fan_list
global cjk_count
global unicode_count
import os, sys
global main_directory
#if packaged by pyinstaller
#ref: https://stackoverflow.com/questions/404744/determining-application-path-in-a-python-exe-gen... | 43.371287 | 259 | 0.523228 | global cjk_list
global unicode_list
global cjk_jian_list
global cjk_jian_fan_list
global cjk_fan_list
global cjk_count
global unicode_count
import os, sys
global main_directory
#if packaged by pyinstaller
#ref: https://stackoverflow.com/questions/404744/determining-application-path-in-a-python-exe-gen... | 1,674 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0a5395d0a2140ef5a5cc84548608073aba17fcf4 | 64,562 | py | Python | lldb_commands/dclass.py | lanza/ds-lldb | fdab1addb05c571460ad31b3256688a223a5022a | [
"MIT"
] | null | null | null | lldb_commands/dclass.py | lanza/ds-lldb | fdab1addb05c571460ad31b3256688a223a5022a | [
"MIT"
] | null | null | null | lldb_commands/dclass.py | lanza/ds-lldb | fdab1addb05c571460ad31b3256688a223a5022a | [
"MIT"
] | null | null | null | # MIT License
# Copyright (c) 2017 Derek Selander
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... | 41.652903 | 400 | 0.645922 | # MIT License
# Copyright (c) 2017 Derek Selander
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... | 0 | 0 | 0 | 0 | 0 | 55,689 | 0 | -6 | 183 |
221f73105bd9b503a9d81c9f68e5ebf08e4a3a89 | 2,362 | py | Python | src/genconfig/log.py | klihub/gen-config | 29c1b5114247190ca1101bc22c53ac28997d627d | [
"BSD-3-Clause"
] | null | null | null | src/genconfig/log.py | klihub/gen-config | 29c1b5114247190ca1101bc22c53ac28997d627d | [
"BSD-3-Clause"
] | null | null | null | src/genconfig/log.py | klihub/gen-config | 29c1b5114247190ca1101bc22c53ac28997d627d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
set_mask(Logger.default_levels)
| 22.495238 | 71 | 0.588908 | #!/usr/bin/env python3
import re, inspect
class Logger:
LOG_FATAL = 0
LOG_ERROR = 1
LOG_WARNING = 2
LOG_PROGRESS = 3
LOG_INFO = 4
LOG_NOTE = 5
LOG_DEBUG = 6
default_levels = [LOG_WARNING, LOG_PROGRESS]
debug_contexts = []
log_prefix = {
LOG_FATAL: 'fatal error: ',... | 0 | 0 | 0 | 602 | 0 | 1,395 | 0 | -3 | 307 |
7cac0f1cfe59dc8f4cf2a7aaab20ea3f74774e43 | 7,660 | py | Python | circus/plugins/__init__.py | ajah/circus | 4ae397e0f46686edf1013000234b92698231bf40 | [
"Apache-2.0"
] | 1 | 2019-06-13T15:59:34.000Z | 2019-06-13T15:59:34.000Z | circus/plugins/__init__.py | ajah/circus | 4ae397e0f46686edf1013000234b92698231bf40 | [
"Apache-2.0"
] | null | null | null | circus/plugins/__init__.py | ajah/circus | 4ae397e0f46686edf1013000234b92698231bf40 | [
"Apache-2.0"
] | null | null | null | """ Base class to create Circus subscribers plugins.
"""
if __name__ == '__main__':
main()
| 29.236641 | 79 | 0.570496 | """ Base class to create Circus subscribers plugins.
"""
import sys
import logging
import errno
import uuid
import argparse
from circus import zmq
from zmq.eventloop import ioloop, zmqstream
from zmq.utils.jsonapi import jsonmod as json
from circus import logger, __version__
from circus.client import make_message, ca... | 0 | 1,431 | 0 | 2,220 | 0 | 3,272 | 0 | 276 | 359 |
c8eff3d49f91ab01dc95dbb9bbdf8c3c4249b42e | 428 | py | Python | desafios/des109b/teste.py | Ericssm96/python | 764d0d704be685db9e993c4b74d3df78da12cc6f | [
"MIT"
] | null | null | null | desafios/des109b/teste.py | Ericssm96/python | 764d0d704be685db9e993c4b74d3df78da12cc6f | [
"MIT"
] | null | null | null | desafios/des109b/teste.py | Ericssm96/python | 764d0d704be685db9e993c4b74d3df78da12cc6f | [
"MIT"
] | null | null | null | import des109moeda
n1 = float(input('Digite o preo: R$'))
print(f'O valor {des109moeda.moeda(n1)} dobrado {des109moeda.dobro(n1, True)}.')
print(f'O valor {des109moeda.moeda(n1)} pela metade {des109moeda.metade(n1, True)}.')
print(f'O valor {des109moeda.moeda(n1)} aumentado em 15% {des109moeda.aumenta(n1, 15, True... | 47.555556 | 97 | 0.714953 | import des109moeda
n1 = float(input('Digite o preço: R$'))
print(f'O valor {des109moeda.moeda(n1)} dobrado é {des109moeda.dobro(n1, True)}.')
print(f'O valor {des109moeda.moeda(n1)} pela metade é {des109moeda.metade(n1, True)}.')
print(f'O valor {des109moeda.moeda(n1)} aumentado em 15% é {des109moeda.aumenta(n1, 15, ... | 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2f9304fc5642e22578d6f99047f4468709db07d9 | 39,178 | py | Python | sarkas/utilities/io.py | lucianogsilvestri/sarkas | f4ab00014d09976561fbd4349b9d0610e47a61e1 | [
"MIT"
] | null | null | null | sarkas/utilities/io.py | lucianogsilvestri/sarkas | f4ab00014d09976561fbd4349b9d0610e47a61e1 | [
"MIT"
] | null | null | null | sarkas/utilities/io.py | lucianogsilvestri/sarkas | f4ab00014d09976561fbd4349b9d0610e47a61e1 | [
"MIT"
] | null | null | null | """
Module handling the I/O for an MD run.
"""
import re
from IPython import get_ipython
if get_ipython().__class__.__name__ == "ZMQInteractiveShell":
# If you are using Jupyter Notebook
from tqdm import tqdm_notebook as tqdm
else:
# If you are using IPython or Python kernel
FONTS = ["speed", "starwars", ... | 34.793961 | 125 | 0.550105 | """
Module handling the I/O for an MD run.
"""
import csv
import pickle
import re
import sys
import yaml
from copy import copy, deepcopy
from IPython import get_ipython
from numpy import float64
from numpy import load as np_load
from numpy import savetxt, savez, zeros
from numpy.random import randint
from os import lis... | 0 | 4,048 | 0 | 32,709 | 0 | 0 | 0 | 68 | 335 |
f21374e8961ec93ce9e7165adeb1fb7f26b4600c | 4,273 | py | Python | scripts/language_model/conversion_utils/compare_xlnet_pytorch_gluon_model.py | xiaotinghe/gluon-nlp | 3ce9995329fb0d18787019df541d4f229d7c9ded | [
"Apache-2.0"
] | 1 | 2021-06-17T12:59:25.000Z | 2021-06-17T12:59:25.000Z | scripts/language_model/conversion_utils/compare_xlnet_pytorch_gluon_model.py | xiaotinghe/gluon-nlp | 3ce9995329fb0d18787019df541d4f229d7c9ded | [
"Apache-2.0"
] | 3 | 2020-09-01T05:45:57.000Z | 2020-10-22T23:14:20.000Z | scripts/language_model/conversion_utils/compare_xlnet_pytorch_gluon_model.py | xiaotinghe/gluon-nlp | 3ce9995329fb0d18787019df541d4f229d7c9ded | [
"Apache-2.0"
] | 3 | 2021-07-20T07:40:15.000Z | 2021-08-03T08:39:17.000Z | # coding: utf-8
# 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... | 39.201835 | 96 | 0.674234 | # coding: utf-8
# 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... | 0 | 0 | 0 | 0 | 0 | 2,169 | 0 | -8 | 161 |
388e640585fa2c9a76ef6f70de8d309b86953deb | 1,374 | py | Python | dopplerr/tasks/tests/test_download_subtitles.py | Stibbons/sonarr-sub-downloader-docker | 6a2124e1b8b41d0b2ec4845a42b3db9aa10b5702 | [
"MIT"
] | 9 | 2018-04-27T18:49:31.000Z | 2020-01-29T08:23:26.000Z | dopplerr/tasks/tests/test_download_subtitles.py | Stibbons/sonarr-sub-downloader-docker | 6a2124e1b8b41d0b2ec4845a42b3db9aa10b5702 | [
"MIT"
] | 7 | 2017-05-31T16:38:40.000Z | 2017-06-05T12:06:48.000Z | dopplerr/tasks/tests/test_download_subtitles.py | Stibbons/subdlsrv | 6a2124e1b8b41d0b2ec4845a42b3db9aa10b5702 | [
"MIT"
] | 3 | 2018-04-22T08:40:29.000Z | 2018-08-19T00:41:25.000Z | # coding: utf-8
# Standard Libraries
# Dopplerr
| 37.135135 | 98 | 0.679039 | # coding: utf-8
# Standard Libraries
import unittest
from pathlib import Path
# Dopplerr
from dopplerr.tasks.download_subtitles import DownloadSubtitleTask
class TestGlob(unittest.TestCase):
def assert_list_size(self, lst, size):
if len(lst) != size:
self.fail("list size should be {}, is {}... | 0 | 0 | 0 | 1,192 | 0 | 0 | 0 | 42 | 89 |
cb86658971cb216bdc9560ee683f36441b257034 | 27 | py | Python | tests/syntax/backslash_instead_of_slash.py | matan-h/friendly | 3ab0fc6541c837271e8865e247750007acdd18fb | [
"MIT"
] | 287 | 2019-04-08T13:18:29.000Z | 2021-03-14T19:10:21.000Z | tests/syntax/backslash_instead_of_slash.py | matan-h/friendly | 3ab0fc6541c837271e8865e247750007acdd18fb | [
"MIT"
] | 191 | 2019-04-08T14:39:18.000Z | 2021-03-14T22:14:56.000Z | tests/syntax/backslash_instead_of_slash.py | matan-h/friendly | 3ab0fc6541c837271e8865e247750007acdd18fb | [
"MIT"
] | 9 | 2019-04-08T12:54:08.000Z | 2020-11-20T02:26:27.000Z | a = 3 \ 4.0
print('hello')
| 9 | 14 | 0.518519 | a = 3 \ 4.0
print('hello')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c3c65355a7596d90458cda447d86bf73b1d7d9b3 | 413 | py | Python | app.py | nick-korres/city_guess_api | ac7cbf8d2f710c6e85d3070e30ce7e259f8a79b0 | [
"MIT"
] | null | null | null | app.py | nick-korres/city_guess_api | ac7cbf8d2f710c6e85d3070e30ce7e259f8a79b0 | [
"MIT"
] | null | null | null | app.py | nick-korres/city_guess_api | ac7cbf8d2f710c6e85d3070e30ce7e259f8a79b0 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS
app = Flask(__name__, static_url_path='/static')
app.config.from_object('config.DevConfig')
CORS(app)
ma = Marshmallow(app)
db = SQLAlchemy(app)
from routes import images
app.re... | 17.956522 | 48 | 0.782082 | from flask import Flask
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy
from flask_cors import CORS
app = Flask(__name__, static_url_path='/static')
app.config.from_object('config.DevConfig')
CORS(app)
ma = Marshmallow(app)
db = SQLAlchemy(app)
from routes import images
app.re... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 22 |
a725160631e3fffc2ebff7fa6c999c1d751a9a8b | 3,192 | py | Python | python3/koans/about_scoring_project.py | JosephKiranBabu/python3-koans | 26e5ac5ab3821d5a8e9d32776ac3d65150938d0f | [
"MIT"
] | 1 | 2020-12-17T19:09:58.000Z | 2020-12-17T19:09:58.000Z | python3/koans/about_scoring_project.py | JosephKiranBabu/python3-koans | 26e5ac5ab3821d5a8e9d32776ac3d65150938d0f | [
"MIT"
] | null | null | null | python3/koans/about_scoring_project.py | JosephKiranBabu/python3-koans | 26e5ac5ab3821d5a8e9d32776ac3d65150938d0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Greed is a dice game where you roll up to five dice to accumulate
# points. The following "score" function will be used calculate the
# score of a single roll of the dice.
#
# A greed roll is scored as follows:
#
# * A set of three ones is 1000 points
#
# * A set of thr... | 29.284404 | 79 | 0.622807 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
# Greed is a dice game where you roll up to five dice to accumulate
# points. The following "score" function will be used calculate the
# score of a single roll of the dice.
#
# A greed roll is scored as follows:
#
# * A set of three ones is 100... | 0 | 0 | 0 | 1,239 | 0 | 902 | 0 | 4 | 160 |
3124a8905edfb540210abb3d2bbcb440586edbeb | 796 | py | Python | Matrices.py | huisaluisqj/Castor | 7a41f2ff8196f90e59d8b1e3da56e7b2a2cdac5d | [
"MIT"
] | null | null | null | Matrices.py | huisaluisqj/Castor | 7a41f2ff8196f90e59d8b1e3da56e7b2a2cdac5d | [
"MIT"
] | null | null | null | Matrices.py | huisaluisqj/Castor | 7a41f2ff8196f90e59d8b1e3da56e7b2a2cdac5d | [
"MIT"
] | 2 | 2020-08-12T00:45:07.000Z | 2020-08-12T02:42:54.000Z | # Funcin de generacin de matrices de clases y caractersticas
| 21.513514 | 66 | 0.636935 | # Función de generación de matrices de clases y características
def generateMatrice(data, K_mer, k):
# Variables
X = []
y = []
# Generar diccionario K-mer
X_dict = {}
for i, e in enumerate(K_mer): X_dict[e] = 0;
# Generar X (atributos de matriz)
for d in data:
x = []
x_dict = X_dict.copy()
# Contar oc... | 8 | 0 | 0 | 0 | 0 | 703 | 0 | 0 | 22 |
9125cd0fc3e838e23d42032ebe3f4ad39140e1fb | 7,245 | py | Python | ProjectFireQuake/assets/dash_plot.py | MariannaMangat/FireQuake | 0a1d2162d9ce60bc6e53f956f0e0d8a39008ac36 | [
"MIT"
] | 1 | 2018-10-03T05:17:43.000Z | 2018-10-03T05:17:43.000Z | ProjectFireQuake/assets/dash_plot.py | MariannaMangat/Firequake | 0a1d2162d9ce60bc6e53f956f0e0d8a39008ac36 | [
"MIT"
] | null | null | null | ProjectFireQuake/assets/dash_plot.py | MariannaMangat/Firequake | 0a1d2162d9ce60bc6e53f956f0e0d8a39008ac36 | [
"MIT"
] | 2 | 2018-12-05T18:58:41.000Z | 2020-06-30T12:12:51.000Z | # import dash
# import dash_core_components as dcc
# import dash_html_components as html
# import pandas as pd
# import plotly.graph_objs as go
# from dash.dependencies import Input, Output
# import requests, json
# # df = pd.read_csv(
# # 'wiki_fires_cleaned_2015-2018.csv')
# year_data = requests.get("h... | 32.782805 | 103 | 0.529745 | # import dash
# import dash_core_components as dcc
# import dash_html_components as html
# import pandas as pd
# import plotly.graph_objs as go
# from dash.dependencies import Input, Output
# import requests, json
# # df = pd.read_csv(
# # 'wiki_fires_cleaned_2015-2018.csv')
# year_data = requests.get("h... | 0 | 3,031 | 0 | 0 | 0 | 749 | 0 | 37 | 148 |
e08dbfa0b08b84419e4f2dcf2847e0cada947e96 | 6,375 | py | Python | experiments/tests/tests.py | Socrats/beelbe | fcd051ea9385660d2cfd40e5d53c5bf6f13636a6 | [
"Apache-2.0"
] | null | null | null | experiments/tests/tests.py | Socrats/beelbe | fcd051ea9385660d2cfd40e5d53c5bf6f13636a6 | [
"Apache-2.0"
] | null | null | null | experiments/tests/tests.py | Socrats/beelbe | fcd051ea9385660d2cfd40e5d53c5bf6f13636a6 | [
"Apache-2.0"
] | null | null | null | from django.contrib.sessions.middleware import SessionMiddleware
import experiments.utils as utils
# Create your tests here.
def add_session_to_request(request):
"""Annotate a request object with a session"""
middleware = SessionMiddleware()
middleware.process_request(request)
request.session.sav... | 38.173653 | 118 | 0.640471 | from django.contrib.sessions.middleware import SessionMiddleware
from django.test import TestCase, RequestFactory
from django.urls import reverse
from django.utils import timezone
import experiments.utils as utils
from experiments.models import RequestMonitor, Player, Experiment, Treatment, Session
from experiments.vi... | 0 | 0 | 0 | 5,639 | 0 | 0 | 0 | 162 | 247 |
67382531729b61a696d40d490aadde39f69ffbf0 | 730 | py | Python | xoeuf/cli/server.py | merchise-autrement/xoeuf | 583a0faa345480e73110d467203eefd142b0a710 | [
"BSD-3-Clause"
] | 3 | 2015-05-16T04:40:14.000Z | 2016-01-26T05:36:20.000Z | xoeuf/cli/server.py | merchise-autrement/xoeuf | 583a0faa345480e73110d467203eefd142b0a710 | [
"BSD-3-Clause"
] | null | null | null | xoeuf/cli/server.py | merchise-autrement/xoeuf | 583a0faa345480e73110d467203eefd142b0a710 | [
"BSD-3-Clause"
] | 1 | 2017-03-23T23:08:50.000Z | 2017-03-23T23:08:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) Merchise Autrement [~/~] and Contributors
# All rights reserved.
#
# This is free software; you can do what the LICENCE file allows you to.
#
"""An example of an application that use :m... | 24.333333 | 79 | 0.632877 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) Merchise Autrement [~º/~] and Contributors
# All rights reserved.
#
# This is free software; you can do what the LICENCE file allows you to.
#
"""An example of an application that use :... | 2 | 0 | 0 | 0 | 0 | 109 | 0 | 0 | 23 |
e4bfeb3e23d955a6c65e9f90b941d39dd92f5f1d | 2,959 | py | Python | backend/pollaris/app/migrations/0007_drop_fks.py | Elizabeth-Warren/pollaris | 153ca4297ceed1ac1685ca80c5890384800cfa8a | [
"MIT"
] | 78 | 2020-03-27T14:49:11.000Z | 2021-11-15T10:24:11.000Z | backend/pollaris/app/migrations/0007_drop_fks.py | Elizabeth-Warren/pollaris | 153ca4297ceed1ac1685ca80c5890384800cfa8a | [
"MIT"
] | 10 | 2020-06-06T01:47:56.000Z | 2022-02-27T23:34:30.000Z | backend/pollaris/app/migrations/0007_drop_fks.py | Elizabeth-Warren/pollaris | 153ca4297ceed1ac1685ca80c5890384800cfa8a | [
"MIT"
] | 14 | 2020-03-27T17:36:30.000Z | 2020-05-21T04:50:07.000Z | # Generated by Django 2.2.6 on 2019-12-12 22:24
| 32.877778 | 61 | 0.532612 | # Generated by Django 2.2.6 on 2019-12-12 22:24
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("app", "0006_nullable_fields_location")]
operations = [
migrations.AlterField(
model_name="precincttodropboxl... | 0 | 0 | 0 | 2,812 | 0 | 0 | 0 | 30 | 68 |
918fcefb7037542c10d27b6f662cacfc4d637c78 | 16,227 | py | Python | vo/orb/pattern.py | yangzuyuanhao/vin | 0f485fcb6bf53341898142021b6a1295a0ca87a3 | [
"MIT"
] | 1 | 2022-03-23T01:13:57.000Z | 2022-03-23T01:13:57.000Z | vo/orb/pattern.py | yangzuyuanhao/vin | 0f485fcb6bf53341898142021b6a1295a0ca87a3 | [
"MIT"
] | null | null | null | vo/orb/pattern.py | yangzuyuanhao/vin | 0f485fcb6bf53341898142021b6a1295a0ca87a3 | [
"MIT"
] | null | null | null |
bit_pattern_31 = \
[
8,-3, 9,5, #/*mean (0), correlation (0)*/,
4,2, 7,-12, #/*mean (1.12461e-05), correlation (0.0437584)*/,
-11,9, -8,2, #/*mean (3.37382e-05), correlation (0.0617409)*/,
7,-12, 12,-13, #/*mean (5.62303e-05), correlation (0.0636977)*/,
2,-13, 2,12, #/*mean (0.000134953), correlat... | 61.935115 | 68 | 0.542244 |
bit_pattern_31 = \
[
8,-3, 9,5, #/*mean (0), correlation (0)*/,
4,2, 7,-12, #/*mean (1.12461e-05), correlation (0.0437584)*/,
-11,9, -8,2, #/*mean (3.37382e-05), correlation (0.0617409)*/,
7,-12, 12,-13, #/*mean (5.62303e-05), correlation (0.0636977)*/,
2,-13, 2,12, #/*mean (0.000134953), correlat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
caf7c306aef08c0285ab718e60cefb0c9fe1db35 | 12,028 | py | Python | scripts/make_dist.py | JamesHutchison/brython | 3beb92bb6125a3e2e96b3e25e8fdac5f73a58871 | [
"BSD-3-Clause"
] | null | null | null | scripts/make_dist.py | JamesHutchison/brython | 3beb92bb6125a3e2e96b3e25e8fdac5f73a58871 | [
"BSD-3-Clause"
] | null | null | null | scripts/make_dist.py | JamesHutchison/brython | 3beb92bb6125a3e2e96b3e25e8fdac5f73a58871 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Script to compact all Brython scripts in a single one."""
import datetime
import os
import sys
import tarfile
import zipfile
try:
import slimit
minify = slimit.minify
except ImportError:
minify = slimit = None
# path of parent directory
pdir = os.path.dirname(os.getcwd())
#... | 34.267806 | 93 | 0.565264 | # -*- coding: utf-8 -*-
"""Script to compact all Brython scripts in a single one."""
import datetime
import os
import re
import sys
import tarfile
import zipfile
import make_static_doc # lint:ok
try:
import slimit
minify = slimit.minify
except ImportError:
minify = slimit = None
# path of parent di... | 0 | 0 | 0 | 0 | 0 | 2,683 | 0 | -11 | 125 |
dcef7a43e88bcdbb0838537455cc888ca94069c0 | 1,865 | py | Python | Day14/higher_lower.py | Abubutt/My100DaysOfCode | d049185547f0101f5b97517399efdbbb3a5c6496 | [
"MIT"
] | null | null | null | Day14/higher_lower.py | Abubutt/My100DaysOfCode | d049185547f0101f5b97517399efdbbb3a5c6496 | [
"MIT"
] | null | null | null | Day14/higher_lower.py | Abubutt/My100DaysOfCode | d049185547f0101f5b97517399efdbbb3a5c6496 | [
"MIT"
] | null | null | null | from game_data import data
from art import logo, vs
import random
import os
def compare(choice, curr, compare_against, points, game_is_over):
"""Compares the players choice with the other choice and updates game_is_over, 'Compare A' and points. Returns points and game_is_over."""
if choice == curr and choice[... | 36.568627 | 142 | 0.618767 | from game_data import data
from art import logo, vs
import random
import os
def compare(choice, curr, compare_against, points, game_is_over):
"""Compares the players choice with the other choice and updates game_is_over, 'Compare A' and points. Returns points and game_is_over."""
if choice == curr and choice[... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
40107f17e8133f5b16a5930391e91bf5c6691d3b | 14,793 | py | Python | src/python/WMCore/WMSpec/Steps/Templates/CMSSW.py | hufnagel/WMCore | b150cc725b68fc1cf8e6e0fa07c826226a4421fa | [
"Apache-2.0"
] | 1 | 2015-02-05T13:43:46.000Z | 2015-02-05T13:43:46.000Z | src/python/WMCore/WMSpec/Steps/Templates/CMSSW.py | hufnagel/WMCore | b150cc725b68fc1cf8e6e0fa07c826226a4421fa | [
"Apache-2.0"
] | 1 | 2016-10-13T14:57:35.000Z | 2016-10-13T14:57:35.000Z | src/python/WMCore/WMSpec/Steps/Templates/CMSSW.py | hufnagel/WMCore | b150cc725b68fc1cf8e6e0fa07c826226a4421fa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
_CMSSW_
Template for a CMSSW Step
"""
| 30.56405 | 106 | 0.63503 | #!/usr/bin/env python
"""
_CMSSW_
Template for a CMSSW Step
"""
import pickle
from WMCore.WMSpec.ConfigSectionTree import nodeName
from WMCore.WMSpec.Steps.Template import CoreHelper, Template
class CMSSWStepHelper(CoreHelper):
"""
_CMSSWStepHelper_
Add API calls and helper methods to the basic WMSte... | 0 | 0 | 0 | 14,548 | 0 | 0 | 0 | 63 | 114 |
f4485ba2649f49ec2f52ff17cf8af227d1239414 | 4,669 | py | Python | src/python/make_toplevel.py | kf7lsu/RegfileCompiler-public | 0845f1458137cef06d584047bb4287a72c6afbab | [
"Apache-2.0"
] | null | null | null | src/python/make_toplevel.py | kf7lsu/RegfileCompiler-public | 0845f1458137cef06d584047bb4287a72c6afbab | [
"Apache-2.0"
] | null | null | null | src/python/make_toplevel.py | kf7lsu/RegfileCompiler-public | 0845f1458137cef06d584047bb4287a72c6afbab | [
"Apache-2.0"
] | null | null | null | #Matthew Trahms
#EE 526
#5/25/21
#This file serves as the toplevel generation script. The user will enter
#at least the number entries, bits, and reads, with options to specify
#that the regfile should be split into banks. Vertical banks (v_banks) means
#that the address space will be split between multiple banks. Thi... | 39.235294 | 99 | 0.765046 | #Matthew Trahms
#EE 526
#5/25/21
#This file serves as the toplevel generation script. The user will enter
#at least the number entries, bits, and reads, with options to specify
#that the regfile should be split into banks. Vertical banks (v_banks) means
#that the address space will be split between multiple banks. Thi... | 0 | 0 | 0 | 0 | 0 | 2,333 | 0 | 401 | 332 |
feebba28c40b6e3359fcd65517e17e31597ad388 | 1,164 | py | Python | tools/python/test/test_point.py | babic95/dlib | 285f0255f6deef4e59e97f93023de112594c0741 | [
"BSL-1.0"
] | 11,719 | 2015-01-03T22:38:57.000Z | 2022-03-30T21:45:04.000Z | tools/python/test/test_point.py | KiLJ4EdeN/dlib | eb1f08ce6ab3ca6f9d10425d899103de3c0df56c | [
"BSL-1.0"
] | 2,518 | 2015-01-04T04:38:06.000Z | 2022-03-31T11:55:43.000Z | tools/python/test/test_point.py | KiLJ4EdeN/dlib | eb1f08ce6ab3ca6f9d10425d899103de3c0df56c | [
"BSL-1.0"
] | 3,308 | 2015-01-01T14:34:16.000Z | 2022-03-31T07:20:07.000Z | try:
import cPickle as pickle # Use cPickle on Python 2.7
except ImportError:
| 20.421053 | 57 | 0.543814 | from dlib import point, points
try:
import cPickle as pickle # Use cPickle on Python 2.7
except ImportError:
import pickle
def test_point():
p = point(27, 42)
assert repr(p) == "point(27, 42)"
assert str(p) == "(27, 42)"
assert p.x == 27
assert p.y == 42
ser = pickle.dumps(p, 2)
d... | 0 | 0 | 0 | 0 | 0 | 938 | 0 | 1 | 140 |
3e3949fe63731b232415468a7f16a08adf502c6a | 981 | py | Python | Offer_book_problems/008nextNode_in_BTree.py | zhaoxinlu/leetcode-algorithms | f5e1c94c99628e7fb04ba158f686a55a8093e933 | [
"MIT"
] | null | null | null | Offer_book_problems/008nextNode_in_BTree.py | zhaoxinlu/leetcode-algorithms | f5e1c94c99628e7fb04ba158f686a55a8093e933 | [
"MIT"
] | null | null | null | Offer_book_problems/008nextNode_in_BTree.py | zhaoxinlu/leetcode-algorithms | f5e1c94c99628e7fb04ba158f686a55a8093e933 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Editor: Zhao Xinlu
School: BUPT
Date: 2018-01-23
Function:
"""
def getBTreeNextNode(pNode):
"""
:param pNode:
:return:
"""
if pNode == None:
return None
if pNode.rchild != None:
tmpNode = pNode.rchild
while tmpNode.lchild:
... | 25.153846 | 72 | 0.567788 | # -*- coding: utf-8 -*-
"""
Editor: Zhao Xinlu
School: BUPT
Date: 2018-01-23
Function: 二叉树的下一节点
"""
class BTLinkNode(object):
def __init__(self, elem, lchild=None, rchild=None, parent=None):
self.elem = elem
self.lchild = lchild
self.rchild = rchild
self.parent = parent
def getBTree... | 147 | 0 | 0 | 185 | 0 | 0 | 0 | 0 | 22 |
591a344d3b4ce08a96e8f6be6e20ecc1f055d514 | 4,045 | py | Python | src/plugins/pcr/calender.py | cdlaimin/CoolQBot | eb77046dd9f8c53c4e7b2e8419d2e447261ade97 | [
"MIT"
] | 72 | 2019-10-23T08:07:58.000Z | 2022-03-31T12:02:08.000Z | src/plugins/pcr/calender.py | cdlaimin/CoolQBot | eb77046dd9f8c53c4e7b2e8419d2e447261ade97 | [
"MIT"
] | 87 | 2019-03-11T09:52:31.000Z | 2022-03-21T21:56:48.000Z | src/plugins/pcr/calender.py | cdlaimin/CoolQBot | eb77046dd9f8c53c4e7b2e8419d2e447261ade97 | [
"MIT"
] | 24 | 2019-03-08T08:15:17.000Z | 2021-12-24T05:25:58.000Z | """
https://pcrbot.github.io/pcr-calendar/#cn
"""
calender_obj = Calender()
| 30.413534 | 88 | 0.536712 | """ 日程表
https://pcrbot.github.io/pcr-calendar/#cn
"""
from datetime import datetime, timedelta
from typing import Dict, Optional, Set
import httpx
from nonebot import get_bot
from nonebot.log import logger
from nonebot_plugin_apscheduler import scheduler
from .config import plugin_config
class Calender:
def __... | 564 | 0 | 2,432 | 1,084 | 0 | 0 | 0 | 81 | 179 |
91ded89ee5895b5142e5d05120e0bf5d7092adf9 | 3,151 | py | Python | components/crud-web-apps/common/backend/kubeflow/kubeflow/crud_backend/helpers.py | umka1332/kubeflow | d831d05f8489270211eb547fb80d7adfaa7e1128 | [
"Apache-2.0"
] | 1 | 2021-05-27T15:00:26.000Z | 2021-05-27T15:00:26.000Z | components/crud-web-apps/common/backend/kubeflow/kubeflow/crud_backend/helpers.py | umka1332/kubeflow | d831d05f8489270211eb547fb80d7adfaa7e1128 | [
"Apache-2.0"
] | 60 | 2020-06-08T19:50:01.000Z | 2022-02-09T14:19:26.000Z | components/crud-web-apps/common/backend/kubeflow/kubeflow/crud_backend/helpers.py | umka1332/kubeflow | d831d05f8489270211eb547fb80d7adfaa7e1128 | [
"Apache-2.0"
] | 2 | 2020-06-19T18:51:19.000Z | 2021-08-03T15:11:55.000Z | """
Common helper functions for handling k8s objects information
"""
import datetime as dt
import logging
import os
import re
import yaml
from flask import current_app
log = logging.getLogger(__name__)
def get_prefixed_index_html():
"""
The backend should modify the <base> element of the index.html file to
... | 25.208 | 78 | 0.554745 | """
Common helper functions for handling k8s objects information
"""
import datetime as dt
import logging
import os
import re
import yaml
from flask import current_app
log = logging.getLogger(__name__)
def get_prefixed_index_html():
"""
The backend should modify the <base> element of the index.html file to
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fca9a93153360695e0d8f4b6f9beece87a7f70e5 | 2,009 | py | Python | dist-packages/samba/tests/blackbox/ndrdump.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | 480 | 2015-02-03T11:59:43.000Z | 2022-03-21T13:23:29.000Z | lib/python2.7/site-packages/samba/tests/blackbox/ndrdump.py | brianwrf/pth-toolkit | 3641cdc76c0f52275315c9b18bf08b22521bd4d7 | [
"BSD-2-Clause"
] | 6 | 2015-02-03T14:06:12.000Z | 2021-05-11T12:07:02.000Z | lib/python2.7/site-packages/samba/tests/blackbox/ndrdump.py | brianwrf/pth-toolkit | 3641cdc76c0f52275315c9b18bf08b22521bd4d7 | [
"BSD-2-Clause"
] | 137 | 2015-02-05T13:31:57.000Z | 2022-02-23T09:44:18.000Z | # Blackbox tests for ndrdump
# Copyright (C) 2008 Andrew Tridgell <tridge@samba.org>
# Copyright (C) 2008 Andrew Bartlett <abartlet@samba.org>
# Copyright (C) 2010 Jelmer Vernooij <jelmer@samba.org>
# based on test_smbclient.sh
# This program is free software; you can redistribute it and/or modify
# it under the terms... | 40.18 | 167 | 0.72225 | # Blackbox tests for ndrdump
# Copyright (C) 2008 Andrew Tridgell <tridge@samba.org>
# Copyright (C) 2008 Andrew Bartlett <abartlet@samba.org>
# Copyright (C) 2010 Jelmer Vernooij <jelmer@samba.org>
# based on test_smbclient.sh
# This program is free software; you can redistribute it and/or modify
# it under the terms... | 0 | 0 | 0 | 794 | 0 | 0 | 0 | 0 | 23 |
81b24bed0ebe42d5f358871f7cea3fbf1f53bc73 | 837 | py | Python | esphome/components/rdm6300/binary_sensor.py | TheEggi/esphomeyaml | 98e8cc1edc7b29891e8100eb484922e5c2d4fc33 | [
"MIT"
] | null | null | null | esphome/components/rdm6300/binary_sensor.py | TheEggi/esphomeyaml | 98e8cc1edc7b29891e8100eb484922e5c2d4fc33 | [
"MIT"
] | null | null | null | esphome/components/rdm6300/binary_sensor.py | TheEggi/esphomeyaml | 98e8cc1edc7b29891e8100eb484922e5c2d4fc33 | [
"MIT"
] | null | null | null | import esphome.config_validation as cv
from esphome.components import binary_sensor, rdm6300
from esphome.const import CONF_UID
from . import rdm6300_ns
DEPENDENCIES = ['rdm6300']
CONF_RDM6300_ID = 'rdm6300_id'
RDM6300BinarySensor = rdm6300_ns.class_('RDM6300BinarySensor', binary_sensor.BinarySensor)
CONFIG_SCHEMA =... | 32.192308 | 90 | 0.784946 | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import binary_sensor, rdm6300
from esphome.const import CONF_UID, CONF_ID
from . import rdm6300_ns
DEPENDENCIES = ['rdm6300']
CONF_RDM6300_ID = 'rdm6300_id'
RDM6300BinarySensor = rdm6300_ns.class_('RDM6300BinarySensor', binary... | 0 | 0 | 0 | 0 | 237 | 0 | 0 | 16 | 45 |
09d52eb37970544a99d7c46d2209764658a577e5 | 4,963 | py | Python | checkm/taxonParser.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | checkm/taxonParser.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | checkm/taxonParser.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | ###############################################################################
#
# taxonParser.py - parse taxonomic-specific marker sets
#
###############################################################################
# #
# This prog... | 42.784483 | 135 | 0.535563 | ###############################################################################
#
# taxonParser.py - parse taxonomic-specific marker sets
#
###############################################################################
# #
# This prog... | 0 | 0 | 0 | 3,207 | 0 | 0 | 0 | 124 | 146 |
43350b093630de1460d7a41f738dff3506dbfc5b | 5,368 | py | Python | code/util_db.py | chenyuheng/CTRAS | a755b966ddf32cb7035f93201ce74cf1075f444d | [
"MIT"
] | null | null | null | code/util_db.py | chenyuheng/CTRAS | a755b966ddf32cb7035f93201ce74cf1075f444d | [
"MIT"
] | null | null | null | code/util_db.py | chenyuheng/CTRAS | a755b966ddf32cb7035f93201ce74cf1075f444d | [
"MIT"
] | 1 | 2020-11-12T12:31:51.000Z | 2020-11-12T12:31:51.000Z | #-*- coding:utf-8 -*-
# ---------------------------------------------------------------------------------------
# Description : Database Processor
# ---------------------------------------------------------------------------------------
# duplicate_tag is the group id.
# retrieve all different sentence candadite of... | 30.5 | 214 | 0.670268 | #-*- coding:utf-8 -*-
import sqlite3
# ---------------------------------------------------------------------------------------
# Description : Database Processor
# ---------------------------------------------------------------------------------------
class Cluster:
cluster_id = None
reports = []
def __init__(s... | 0 | 0 | 0 | 339 | 0 | 4,309 | 0 | -7 | 365 |
a2d4f21eeb08c513b2b172867c62fd0a262e64ec | 120 | py | Python | run.py | ivanlmj/puppy | 172ea0af3bad9d930a428bf839b8699398a2e9d9 | [
"Apache-2.0"
] | null | null | null | run.py | ivanlmj/puppy | 172ea0af3bad9d930a428bf839b8699398a2e9d9 | [
"Apache-2.0"
] | 4 | 2018-12-03T16:10:53.000Z | 2018-12-06T20:21:16.000Z | run.py | ivanlmj/puppy | 172ea0af3bad9d930a428bf839b8699398a2e9d9 | [
"Apache-2.0"
] | 1 | 2018-10-20T16:54:48.000Z | 2018-10-20T16:54:48.000Z | #!/usr/bin/python3
from app import app
__author__ = "@ivanleoncz"
if __name__ == "__main__":
app.run(debug=True)
| 13.333333 | 26 | 0.683333 | #!/usr/bin/python3
from app import app
__author__ = "@ivanleoncz"
if __name__ == "__main__":
app.run(debug=True)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
12871fa76af694cd535a0687e91ea2c9c06589f4 | 5,056 | py | Python | ClassifierDataPrepper.py | pierremtb/paragraph-vector-baselines | 9ad6855f632323a60bd4bcc82cd1a6371808c0ac | [
"MIT"
] | null | null | null | ClassifierDataPrepper.py | pierremtb/paragraph-vector-baselines | 9ad6855f632323a60bd4bcc82cd1a6371808c0ac | [
"MIT"
] | null | null | null | ClassifierDataPrepper.py | pierremtb/paragraph-vector-baselines | 9ad6855f632323a60bd4bcc82cd1a6371808c0ac | [
"MIT"
] | null | null | null | # COMP 551 Mini Project 4
# 2019-04-17
# Segev, Michael
# Jacquier, Pierre
# Han, Zhenze
# loads and formats data from stanford sentiment tree bank
| 34.630137 | 98 | 0.552017 | # COMP 551 Mini Project 4
# 2019-04-17
# Segev, Michael
# Jacquier, Pierre
# Han, Zhenze
# loads and formats data from stanford sentiment tree bank
import re
import numpy as np
class ClassifierDataPrepper:
def __init__(self, dataPath):
# read the sentences
with open(dataPath + "dictionary.txt") a... | 0 | 0 | 0 | 4,854 | 0 | 0 | 0 | -15 | 68 |
4ae352d11b5df568ad63367e6fa6d00dc70203c7 | 13,388 | py | Python | radon/tests/test_complexity_visitor.py | DolajoCZ/radon | 316965b27f1ee9228d8556abc08551381a9e569b | [
"MIT"
] | 943 | 2015-01-05T22:02:39.000Z | 2022-03-31T19:33:08.000Z | radon/tests/test_complexity_visitor.py | DolajoCZ/radon | 316965b27f1ee9228d8556abc08551381a9e569b | [
"MIT"
] | 165 | 2015-01-03T16:37:23.000Z | 2022-03-31T15:01:04.000Z | radon/tests/test_complexity_visitor.py | DolajoCZ/radon | 316965b27f1ee9228d8556abc08551381a9e569b | [
"MIT"
] | 108 | 2015-01-03T16:22:14.000Z | 2022-03-02T16:27:36.000Z | import sys
import textwrap
dedent = lambda code: textwrap.dedent(code).strip()
SIMPLE_BLOCKS = [
(
'''
if a: pass
''',
2,
{},
),
(
'''
if a: pass
else: pass
''',
2,
{},
),
(
'''
if a: pass
elif b: pass
... | 18.776999 | 76 | 0.412459 | import sys
import textwrap
import pytest
from radon.visitors import *
dedent = lambda code: textwrap.dedent(code).strip()
SIMPLE_BLOCKS = [
(
'''
if a: pass
''',
2,
{},
),
(
'''
if a: pass
else: pass
''',
2,
{},
),
(
... | 0 | 2,717 | 0 | 0 | 0 | 0 | 0 | -1 | 207 |
4d927900145a4013c6fd9c6f27960c5b3f0b35e5 | 1,819 | py | Python | models/av_fusion.py | yang-zj1026/CS386_Project2 | 1a353086487e5fd4c4465566a1673c9495f5bb6c | [
"MIT"
] | null | null | null | models/av_fusion.py | yang-zj1026/CS386_Project2 | 1a353086487e5fd4c4465566a1673c9495f5bb6c | [
"MIT"
] | null | null | null | models/av_fusion.py | yang-zj1026/CS386_Project2 | 1a353086487e5fd4c4465566a1673c9495f5bb6c | [
"MIT"
] | null | null | null | import torch.nn as nn
| 41.340909 | 116 | 0.640462 | import torch
import torch.nn as nn
from models.dsam_layers import center_crop
class av_module(nn.Module):
def __init__(self, rgb_nfilters, audio_nfilters, img_size, temp_size, hidden_layers):
super(av_module, self).__init__()
self.rgb_nfilters = rgb_nfilters
self.audio_nfilters = audio_n... | 0 | 0 | 0 | 1,717 | 0 | 0 | 0 | 12 | 67 |
fa66763cb6972a92806bcf929a87e7d65ee83a88 | 425 | py | Python | soustypes.py | geocot/Python_ArcGIS_Desktop | aef5d855d8ce3f564dd4fba80599be32b89fcb5b | [
"Apache-2.0"
] | null | null | null | soustypes.py | geocot/Python_ArcGIS_Desktop | aef5d855d8ce3f564dd4fba80599be32b89fcb5b | [
"Apache-2.0"
] | null | null | null | soustypes.py | geocot/Python_ArcGIS_Desktop | aef5d855d8ce3f564dd4fba80599be32b89fcb5b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import arcpy
arcpy.env.workspace = "C:/Temp/donnees.gdb"
soustypes = arcpy.da.ListSubtypes("villes")
for stcode, stdict in list(soustypes.items()):
print("code: ", stcode, " nom: ", stdict['Name'], " defaut: ", stdict['Default'])
"""
Retourne ceci:
('code: ', 0, ' no... | 22.368421 | 86 | 0.592941 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import arcpy
arcpy.env.workspace = "C:/Temp/donnees.gdb"
soustypes = arcpy.da.ListSubtypes("villes")
for stcode, stdict in list(soustypes.items()):
print("code: ", stcode, " nom: ", stdict['Name'], " defaut: ", stdict['Default'])
"""
Retourne ceci:
('code: ', 0, ' no... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ed20f595ddcce0ce41c67515c8bef7687b70e532 | 2,379 | py | Python | src/site/cms/build/mdx_addheaderlinkcss.py | hpham/odftoolkit | cace01f463e49d2cb85579482605780ddf8a5e9e | [
"Apache-2.0"
] | 75 | 2018-12-13T16:05:55.000Z | 2022-02-08T18:42:56.000Z | src/site/cms/build/mdx_addheaderlinkcss.py | hpham/odftoolkit | cace01f463e49d2cb85579482605780ddf8a5e9e | [
"Apache-2.0"
] | 99 | 2019-02-14T11:09:45.000Z | 2022-03-02T19:05:11.000Z | src/site/cms/build/mdx_addheaderlinkcss.py | hpham/odftoolkit | cace01f463e49d2cb85579482605780ddf8a5e9e | [
"Apache-2.0"
] | 42 | 2019-02-15T11:06:34.000Z | 2022-02-09T02:35:36.000Z | #!
# coding:utf-8
'''
Add headerlink Extension for Python-Markdown
==========================================
This extension adds headerlink CSS to the output HTML in Python-Markdown.
This is intended for use with TocExtension(permalink=True) which generates the links
Simple Usage:
>>> import markdown
>>>... | 30.896104 | 91 | 0.654897 | #!
# coding:utf-8
'''
Add headerlink Extension for Python-Markdown
==========================================
This extension adds headerlink CSS to the output HTML in Python-Markdown.
This is intended for use with TocExtension(permalink=True) which generates the links
Simple Usage:
>>> import markdown
>>>... | 0 | 0 | 0 | 773 | 0 | 54 | 0 | 58 | 179 |
7d90044a4e3bb406aaeb8545599f0b25f2f9de09 | 3,545 | py | Python | maze_exploration/showmaze.py | TSchattschneider/MazeExploration | 19949457971241a0eff5894be4ea9aa0072eb6bd | [
"MIT"
] | 1 | 2021-03-18T17:25:08.000Z | 2021-03-18T17:25:08.000Z | maze_exploration/showmaze.py | TSchattschneider/MazeExploration | 19949457971241a0eff5894be4ea9aa0072eb6bd | [
"MIT"
] | null | null | null | maze_exploration/showmaze.py | TSchattschneider/MazeExploration | 19949457971241a0eff5894be4ea9aa0072eb6bd | [
"MIT"
] | null | null | null | import json
import sys
import turtle
from maze import Maze
def draw_path(filepath, pen, origin, sq_size):
""""Reads a path from a file and draws it on the maze."""
first = True
with open(filepath, 'r') as file_object:
for line in file_object:
x, y, visited, heading = json.loads(line)
... | 30.299145 | 74 | 0.530606 | import json
import sys
import turtle
from maze import Maze
def draw_path(filepath, pen, origin, sq_size):
""""Reads a path from a file and draws it on the maze."""
first = True
with open(filepath, 'r') as file_object:
for line in file_object:
x, y, visited, heading = json.loads(line)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
45996bd75386e35e2553f01df2c921844ec3804f | 394 | py | Python | SoftLayer/shell/routes.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 126 | 2015-01-05T05:09:22.000Z | 2021-07-02T00:16:35.000Z | SoftLayer/shell/routes.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 969 | 2015-01-05T15:55:31.000Z | 2022-03-31T19:55:20.000Z | SoftLayer/shell/routes.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 176 | 2015-01-22T11:23:40.000Z | 2022-02-11T13:16:58.000Z | """
SoftLayer.CLI.routes
~~~~~~~~~~~~~~~~~~~
Routes for shell-specific commands
:license: MIT, see LICENSE for more details.
"""
ALL_ROUTES = [
('exit', 'SoftLayer.shell.cmd_exit:cli'),
('shell-help', 'SoftLayer.shell.cmd_help:cli'),
('env', 'SoftLayer.shell.cmd_env:cli'),
]
ALL_ALIASES =... | 19.7 | 51 | 0.56599 | """
SoftLayer.CLI.routes
~~~~~~~~~~~~~~~~~~~
Routes for shell-specific commands
:license: MIT, see LICENSE for more details.
"""
ALL_ROUTES = [
('exit', 'SoftLayer.shell.cmd_exit:cli'),
('shell-help', 'SoftLayer.shell.cmd_help:cli'),
('env', 'SoftLayer.shell.cmd_env:cli'),
]
ALL_ALIASES =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2c4ac8b7a30c10bdaf41728053de8eb250b5ee56 | 31,337 | py | Python | dist/gbif2estimateS.py | xjpalma/gbif2estimateS | b9e25b0de3996b1d2502d02738fa1e9e8d33f9b7 | [
"MIT"
] | null | null | null | dist/gbif2estimateS.py | xjpalma/gbif2estimateS | b9e25b0de3996b1d2502d02738fa1e9e8d33f9b7 | [
"MIT"
] | null | null | null | dist/gbif2estimateS.py | xjpalma/gbif2estimateS | b9e25b0de3996b1d2502d02738fa1e9e8d33f9b7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on Thu Oct 31 11:09:38 2019
@author: Jorge palma
MARETEC/Instituto Superior Tcnico
Universidade de Lisboa
'''
import sys
import os
import gc
import argparse
import time
import datetime
import pandas as pd
import random
## python-geohash: htt... | 39.717364 | 235 | 0.606695 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on Thu Oct 31 11:09:38 2019
@author: Jorge palma
MARETEC/Instituto Superior Técnico
Universidade de Lisboa
'''
import sys
import os
import gc
import argparse
import traceback
import time
import datetime
import pandas as pd
import json
import ... | 2 | 0 | 0 | 10,576 | 0 | 1,582 | 0 | 1 | 294 |
b6f4ab43343140abcd5bc0b46526c1de04b55594 | 9,097 | py | Python | applications/twolevel_model_building.py | bcdarwin/pydpiper | 7ac70ecc1f2dc4609395e1136fb312b6fef40dcc | [
"BSD-3-Clause"
] | null | null | null | applications/twolevel_model_building.py | bcdarwin/pydpiper | 7ac70ecc1f2dc4609395e1136fb312b6fef40dcc | [
"BSD-3-Clause"
] | null | null | null | applications/twolevel_model_building.py | bcdarwin/pydpiper | 7ac70ecc1f2dc4609395e1136fb312b6fef40dcc | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import logging
logger = logging.getLogger(__name__)
if __name__ == "__main__":
application = LongitudinalTwolevelNlin()
application.start()
| 52.281609 | 119 | 0.572387 | #!/usr/bin/env python
from pydpiper.application import AbstractApplication
import atoms_and_modules.registration_functions as rf
import atoms_and_modules.minc_modules as mm
import atoms_and_modules.minc_parameters as mp
import atoms_and_modules.LSQ6 as lsq6
import atoms_and_modules.LSQ12 as lsq12
import atoms_and_modu... | 0 | 0 | 0 | 8,423 | 0 | 0 | 0 | 228 | 266 |
20652bad1ff1459dd7113b64293e10f2385a3694 | 442 | py | Python | compound-interest-calculator.py | ADcadia/Compound-Interest-Calculator | b57e5a4deab3090abc708fd8ad6556fc28d90f7b | [
"Unlicense"
] | null | null | null | compound-interest-calculator.py | ADcadia/Compound-Interest-Calculator | b57e5a4deab3090abc708fd8ad6556fc28d90f7b | [
"Unlicense"
] | null | null | null | compound-interest-calculator.py | ADcadia/Compound-Interest-Calculator | b57e5a4deab3090abc708fd8ad6556fc28d90f7b | [
"Unlicense"
] | null | null | null | # Enter the interest rate (%) as a float (ex. 4% = .04).
P = int(input("What is the principal? \n \n"))
n = int(input("How many compoundings per year? \n \n"))
r = float(input("What is the interest rate? \n \n"))
t = int(input("How many years will your money be compounded for? \n \n"))
Total_money_compounded = P * (... | 40.181818 | 92 | 0.635747 | # Enter the interest rate (%) as a float (ex. 4% = .04).
P = int(input("What is the principal? \n \n"))
n = int(input("How many compoundings per year? \n \n"))
r = float(input("What is the interest rate? \n \n"))
t = int(input("How many years will your money be compounded for? \n \n"))
Total_money_compounded = P * (... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5d45181d4c435134e01529e46c42e91dbd3990da | 849 | py | Python | example/bert_to_wordvec.py | zhupengjia/simple_kbqa | 5a56bc27454442909275eb19d97a0e3a208257f5 | [
"Apache-2.0"
] | null | null | null | example/bert_to_wordvec.py | zhupengjia/simple_kbqa | 5a56bc27454442909275eb19d97a0e3a208257f5 | [
"Apache-2.0"
] | null | null | null | example/bert_to_wordvec.py | zhupengjia/simple_kbqa | 5a56bc27454442909275eb19d97a0e3a208257f5 | [
"Apache-2.0"
] | 1 | 2019-12-11T06:33:18.000Z | 2019-12-11T06:33:18.000Z | #!/usr/bin/env python
import sys, os, h5py
from transformers import BertModel, BertTokenizer
from nlptools.utils import zdump
model_path = sys.argv[1] if len(sys.argv) > 1 else "."
model_name = "bert-base-uncased"
vocab_name = os.path.join(model_path, 'vocab')
weight_path = os.path.join(model_path, '{}.h5py'.format(mo... | 27.387097 | 72 | 0.765607 | #!/usr/bin/env python
import sys, os, torch, h5py
from transformers import BertModel, BertTokenizer
from nlptools.utils import zdump
model_path = sys.argv[1] if len(sys.argv) > 1 else "."
model_name = "bert-base-uncased"
vocab_name = os.path.join(model_path, 'vocab')
weight_path = os.path.join(model_path, '{}.h5py'.fo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0 |
c574eb814dd96cab84aba69f09fb9dd973154144 | 357 | py | Python | day1/part_two.py | hmart90/advent-of-code | b7bc05bc837a87c50cad6e1ed739704e49652f68 | [
"Apache-2.0"
] | null | null | null | day1/part_two.py | hmart90/advent-of-code | b7bc05bc837a87c50cad6e1ed739704e49652f68 | [
"Apache-2.0"
] | null | null | null | day1/part_two.py | hmart90/advent-of-code | b7bc05bc837a87c50cad6e1ed739704e49652f68 | [
"Apache-2.0"
] | null | null | null | FILENAME = './day1/data/input'
measurements = []
with open(FILENAME) as file:
for line in file:
measurements.append(int(line.strip()))
s = 0
for i in range(3, len(measurements)):
if measurements[i] + measurements[i - 1] + measurements[i - 2] > measurements[i - 1] + measurements[i - 2] + measurements... | 22.3125 | 133 | 0.619048 | FILENAME = './day1/data/input'
measurements = []
with open(FILENAME) as file:
for line in file:
measurements.append(int(line.strip()))
s = 0
for i in range(3, len(measurements)):
if measurements[i] + measurements[i - 1] + measurements[i - 2] > measurements[i - 1] + measurements[i - 2] + measurements... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
df61160f4bb8361f95ff1dcfb8e914e74180d926 | 6,879 | py | Python | tests/test_gyomu_data_schema.py | Yoshihisa-Matsumoto/Gyomu_Python | c79a262d65ac6e23535731e30c9cacd9698ad626 | [
"MIT"
] | null | null | null | tests/test_gyomu_data_schema.py | Yoshihisa-Matsumoto/Gyomu_Python | c79a262d65ac6e23535731e30c9cacd9698ad626 | [
"MIT"
] | null | null | null | tests/test_gyomu_data_schema.py | Yoshihisa-Matsumoto/Gyomu_Python | c79a262d65ac6e23535731e30c9cacd9698ad626 | [
"MIT"
] | null | null | null |
gyomuapps_schema = GyomuAppsSchema()
gyomuapps_total_list_schema = GyomuAppsSchema(many=True)
gyomuapps_schema_load = GyomuAppsSchema(load_instance=True)
gyomuapps_total_list_schema_load = GyomuAppsSchema(many=True, load_instance=True)
TEST_APPLICATION_ID2 = 32651
TEST_APPLICAIONT_ID3 = 32652
| 62.536364 | 503 | 0.767553 | import pytest
from gyomu.gyomu_db_model import *
from gyomu.gyomu_db_schema import *
from gyomu.user_factory import UserFactory
from gyomu.user import User
from gyomu.db_connection_factory import DbConnectionFactory
from gyomu.json import Json
from marshmallow import ValidationError
gyomuapps_schema = GyomuAppsSchema(... | 0 | 0 | 0 | 6,275 | 0 | 0 | 0 | 108 | 199 |
16b99d957e1208254f4639e5e9bec9c8da6c4bbb | 8,001 | py | Python | _scrap/_naver_stock.py | hopelife/mp_scraper | b3e227573647ca49b3c6c4bd9995a5d4b0d18b20 | [
"MIT"
] | null | null | null | _scrap/_naver_stock.py | hopelife/mp_scraper | b3e227573647ca49b3c6c4bd9995a5d4b0d18b20 | [
"MIT"
] | null | null | null | _scrap/_naver_stock.py | hopelife/mp_scraper | b3e227573647ca49b3c6c4bd9995a5d4b0d18b20 | [
"MIT"
] | null | null | null | import os, sys
from datetime import datetime
# import requests
# import lxml.etree as et
##------------------------------------------------------------
sys.path.append(os.path.join(os.path.dirname(__file__), '../_public')) ## Note:
from utils_basic import (_to_digit, _divide_list)
from utils_scraping import (_r... | 24.393293 | 143 | 0.550681 | import os, sys
import math
import copy
import time
from datetime import datetime
import re
# import requests
import urllib
import lxml.html as ht
# import lxml.etree as et
##------------------------------------------------------------
sys.path.append(os.path.join(os.path.dirname(__file__), '../_public')) ## Note: 현재 ... | 1,137 | 0 | 0 | 0 | 0 | 0 | 0 | 219 | 132 |
bae360ebaf9d4ec0184c5fa64024a723f24ff831 | 982 | py | Python | static_data/main.py | numericalresearch/cloudrisk | 845c1882e48d5a80c1b9a8be336376aea99ba457 | [
"BSD-3-Clause"
] | null | null | null | static_data/main.py | numericalresearch/cloudrisk | 845c1882e48d5a80c1b9a8be336376aea99ba457 | [
"BSD-3-Clause"
] | null | null | null | static_data/main.py | numericalresearch/cloudrisk | 845c1882e48d5a80c1b9a8be336376aea99ba457 | [
"BSD-3-Clause"
] | null | null | null | from azure.cosmos import CosmosClient
RES_GROUP = "my-cosmsos-resource-group"
ACCT_NAME = "my-cosomso-account-name"
url = get_account_uri(RES_GROUP, ACCT_NAME)
key = get_key(RES_GROUP, ACCT_NAME)
print(url, key)
client = CosmosClient(url, credential=key)
| 29.757576 | 119 | 0.720978 | from azure.cosmos import CosmosClient
import subprocess
RES_GROUP = "my-cosmsos-resource-group"
ACCT_NAME = "my-cosomso-account-name"
def get_account_uri(res_group, acct_name):
completed = subprocess.run(
f"az cosmosdb show --resource-group {res_group} --name {acct_name} --query documentEndpoint --outp... | 0 | 0 | 0 | 0 | 0 | 655 | 0 | -4 | 69 |
c3fcbaca838784223014c49db842628ad06159a3 | 944 | py | Python | logging/seqlog/log2seq.py | jgraber/PythonFriday | 879f10934dc6949785e5a799bfc3ca9a2a4434d4 | [
"MIT"
] | 5 | 2021-02-22T08:39:55.000Z | 2022-03-14T03:54:36.000Z | logging/seqlog/log2seq.py | jgraber/PythonFriday | 879f10934dc6949785e5a799bfc3ca9a2a4434d4 | [
"MIT"
] | null | null | null | logging/seqlog/log2seq.py | jgraber/PythonFriday | 879f10934dc6949785e5a799bfc3ca9a2a4434d4 | [
"MIT"
] | null | null | null | import logging
import seqlog
import time
seqlog.log_to_seq(
server_url="http://127.0.0.1:5341/",
api_key="RK2UCFPEIY7dsttQJA9F",
level=logging.NOTSET,
batch_size=10,
auto_flush_timeout=1, # seconds
override_root_logger=True,
# json_encoder_class=json.encoder.JSONEncoder # Optional; only specify ... | 30.451613 | 120 | 0.717161 | import logging
import seqlog
import time
seqlog.log_to_seq(
server_url="http://127.0.0.1:5341/",
api_key="RK2UCFPEIY7dsttQJA9F",
level=logging.NOTSET,
batch_size=10,
auto_flush_timeout=1, # seconds
override_root_logger=True,
# json_encoder_class=json.encoder.JSONEncoder # Optional; only specify ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13eb3536e7ae4e6d1a87ac835080ececff092202 | 1,161 | py | Python | tests/dup_reads.py | robertDT/dt-snap | 5c4b7886336d72d8170371caea09ccd177961aa8 | [
"ECL-2.0",
"Apache-2.0"
] | 219 | 2015-01-18T00:28:42.000Z | 2022-02-10T09:00:10.000Z | tests/dup_reads.py | mateiz/snap | fe0fd2983195e145d0a2330eeda23333df832f56 | [
"ECL-2.0",
"Apache-2.0"
] | 126 | 2015-01-01T08:24:59.000Z | 2022-03-17T23:03:40.000Z | tests/dup_reads.py | mateiz/snap | fe0fd2983195e145d0a2330eeda23333df832f56 | [
"ECL-2.0",
"Apache-2.0"
] | 61 | 2015-01-25T06:28:18.000Z | 2022-02-24T12:01:04.000Z | # dup_reads.py
#
# create duplicate reads
#
import sys
import random
if (len(sys.argv) < 4 or len(sys.argv) > 5):
print "usage: %s <# of duplicate reads> <max duplication> read1.fq [read2.fq]" % sys.argv[p]
exit(1)
dupcount = int(sys.argv[1])
maxdup = int(sys.argv[2])
in1 = open(sys.argv[3], "r")
out1 = ope... | 27 | 104 | 0.55814 | # dup_reads.py
#
# create duplicate reads
#
import sys
import random
def readread(f):
result = [f.readline(),f.readline(),f.readline(),f.readline()]
if (result[0] and (result[0][0] != "@" or result[2][0] != "+" or len(result[1]) != len(result[3]))):
sys.stderr.write("invalid fasta file near %s" % (res... | 0 | 0 | 0 | 0 | 0 | 314 | 0 | 0 | 46 |
af8ceb7e971c9b1e516b864c1368d1deeaaef04d | 16,821 | py | Python | openid_connect_op/views/token_request_view.py | rerobins/django-openid-op | 96952a6d413718d0ed4c656265248b6f0d0c2e4e | [
"MIT"
] | 2 | 2020-02-15T20:20:36.000Z | 2020-05-12T02:39:42.000Z | openid_connect_op/views/token_request_view.py | rerobins/django-openid-op | 96952a6d413718d0ed4c656265248b6f0d0c2e4e | [
"MIT"
] | 3 | 2021-11-24T21:28:52.000Z | 2021-11-24T23:07:57.000Z | openid_connect_op/views/token_request_view.py | rerobins/django-openid-op | 96952a6d413718d0ed4c656265248b6f0d0c2e4e | [
"MIT"
] | 2 | 2019-11-25T07:40:28.000Z | 2021-11-29T16:06:59.000Z |
# section 4.1.3 of OAUTH 2.0
# https://tools.ietf.org/pdf/draft-hunt-oauth-chain-01.pdf
| 44.975936 | 117 | 0.643957 | import base64
import hashlib
import traceback
from django.conf import settings
from django.contrib.auth.models import User
from django.http import HttpResponseBadRequest
from django.utils import timezone
from django.utils.decorators import method_decorator
from django.views import View
from django.views.decorators.csrf... | 0 | 3,565 | 0 | 12,215 | 0 | 136 | 0 | 350 | 464 |
ea7566a7ca97c2ade1f25e7bf6792259a199be6a | 4,895 | py | Python | accident/models/models.py | ElNahoko/HSE_ARNOSH | 1a8661db454e6a9e7f775a3ffd58a3936a43bb59 | [
"Apache-2.0"
] | 1 | 2019-08-10T17:57:58.000Z | 2019-08-10T17:57:58.000Z | accident/models/models.py | ElNahoko/HSE_ARNOSH | 1a8661db454e6a9e7f775a3ffd58a3936a43bb59 | [
"Apache-2.0"
] | null | null | null | accident/models/models.py | ElNahoko/HSE_ARNOSH | 1a8661db454e6a9e7f775a3ffd58a3936a43bb59 | [
"Apache-2.0"
] | 2 | 2019-08-14T18:08:04.000Z | 2019-09-04T19:01:08.000Z | # -*- coding: utf-8 -*-
| 36.529851 | 129 | 0.539939 | # -*- coding: utf-8 -*-
import datetime
from odoo import models, fields, api , _
class res_partner(models.Model):
_inherit = 'res.partner'
class regle(models.Model):
_name = 'reg.reg'
_rec_name = 'nom'
nom = fields.Char(string="Règle", required=False, )
icon = fields.Binary(string="Icone", )
... | 72 | 2,938 | 0 | 1,770 | 0 | 0 | 0 | 13 | 114 |
50f944da55c2a06a0752b38244ab878b2db49ffd | 273 | py | Python | pyRoovit/pyRoovit.extension/pyRoovit.tab/About.Panel/Sources.stack/pyRevit.pushbutton/script.py | jmcouffin/pyRoovit | acafa74fb6310a1042c703d791b0d53804c1882a | [
"BSD-3-Clause"
] | 5 | 2022-03-14T01:58:34.000Z | 2022-03-21T19:51:09.000Z | pyRoovit/pyRoovit.extension/pyRoovit.tab/About.Panel/Sources.stack/pyRevit.pushbutton/script.py | jmcouffin/pyRoovit | acafa74fb6310a1042c703d791b0d53804c1882a | [
"BSD-3-Clause"
] | 1 | 2022-03-14T10:18:40.000Z | 2022-03-14T15:52:25.000Z | pyRoovit/pyRoovit.extension/pyRoovit.tab/About.Panel/Sources.stack/pyRevit.pushbutton/script.py | jmcouffin/pyRoovit | acafa74fb6310a1042c703d791b0d53804c1882a | [
"BSD-3-Clause"
] | 1 | 2022-03-14T10:15:22.000Z | 2022-03-14T10:15:22.000Z | # import libraries
import os
# Get and build the pyrevit path
userProfile = os.environ.get("USERPROFILE")
prvPath = userProfile + '\\AppData\\Roaming\\pyRevit-Master\\'
# Load the path
try:
os.startfile(prvPath)
except:
print('The path was not found.') | 21 | 62 | 0.721612 | # import libraries
import clr
import os
# Get and build the pyrevit path
userProfile = os.environ.get("USERPROFILE")
prvPath = userProfile + '\\AppData\\Roaming\\pyRevit-Master\\'
# Load the path
try:
os.startfile(prvPath)
except:
print('The path was not found.') | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
f7d1e2dc6d984322b052c5f2fa923962ff65e554 | 3,620 | py | Python | preprocess_xsum.py | tdtrinh11/tas-cus | 3383a63ccba18cce437617e67d0650a9c72d2a48 | [
"Apache-2.0"
] | 3 | 2021-09-19T07:15:40.000Z | 2021-11-19T14:13:51.000Z | preprocess_xsum.py | tdtrinh11/tas-cus | 3383a63ccba18cce437617e67d0650a9c72d2a48 | [
"Apache-2.0"
] | 1 | 2022-01-13T07:53:48.000Z | 2022-01-13T07:53:48.000Z | preprocess_xsum.py | tdtrinh11/tas-cus | 3383a63ccba18cce437617e67d0650a9c72d2a48 | [
"Apache-2.0"
] | 1 | 2022-02-02T11:29:50.000Z | 2022-02-02T11:29:50.000Z | """
Preprocess the XSUM dataset
There are several noisy training instances which do not contain any words in pre-defined vocabulary of NTM.
We remove these instances.
Here are the details about these removed instance:
- instance #37993:
input: Here are our favourites:
target: On Monday, we ask... | 55.692308 | 247 | 0.699724 | """
Preprocess the XSUM dataset
There are several noisy training instances which do not contain any words in pre-defined vocabulary of NTM.
We remove these instances.
Here are the details about these removed instance:
- instance #37993:
input: Here are our favourites:
target: On Monday, we ask... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d247519e5c1cf58a5939d0ce0c852ed2f4c4d179 | 6,026 | py | Python | behavioral/model_comparison.py | bobaseb/neural_link_SV_iDE | ff45ec4850dd40e2bdfc153efa45575871cedbd9 | [
"MIT"
] | 3 | 2020-02-19T07:42:54.000Z | 2021-12-29T13:28:07.000Z | behavioral/model_comparison.py | bobaseb/neural_link_SV_iDE | ff45ec4850dd40e2bdfc153efa45575871cedbd9 | [
"MIT"
] | null | null | null | behavioral/model_comparison.py | bobaseb/neural_link_SV_iDE | ff45ec4850dd40e2bdfc153efa45575871cedbd9 | [
"MIT"
] | 3 | 2020-04-02T11:00:45.000Z | 2021-12-29T13:28:35.000Z | import numpy as np
import pandas as pd
import statsmodels.formula.api as sm
from statsmodels.tools.eval_measures import bic
from scipy.stats import pearsonr
parent_dir = '/media/seb/HD_Numba_Juan/Dropbox/postdoc/NARPS/preprint1'
data_fn = parent_dir + '/participants_and_model.csv'
df = pd.read_csv(data_fn)
#list(df.c... | 40.716216 | 146 | 0.724859 | import numpy as np
import pandas as pd
import statsmodels.formula.api as sm
from statsmodels.tools.eval_measures import bic
import time
from scipy.stats import pearsonr
parent_dir = '/media/seb/HD_Numba_Juan/Dropbox/postdoc/NARPS/preprint1'
data_fn = parent_dir + '/participants_and_model.csv'
df = pd.read_csv(data_fn... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
ecebcbe1583f36069a540a75d483c4308fc1b4e4 | 595 | py | Python | code/chapter-1/exercise1_20.py | Kevin-Oudai/python-solutions | d67f6b14723b000fec0011c3e8156b805eb288f7 | [
"MIT"
] | null | null | null | code/chapter-1/exercise1_20.py | Kevin-Oudai/python-solutions | d67f6b14723b000fec0011c3e8156b805eb288f7 | [
"MIT"
] | null | null | null | code/chapter-1/exercise1_20.py | Kevin-Oudai/python-solutions | d67f6b14723b000fec0011c3e8156b805eb288f7 | [
"MIT"
] | null | null | null | import turtle
turtle.forward(300)
turtle.right(120)
turtle.forward(75)
turtle.right(60)
turtle.forward(300)
turtle.right(120)
turtle.forward(75)
turtle.right(150)
turtle.forward(100)
turtle.right(30)
turtle.forward(75)
turtle.left(120)
turtle.forward(300)
turtle.left(60)
turtle.forward(75)
turtle.left(120)
turtle.forw... | 17 | 19 | 0.779832 | import turtle
turtle.forward(300)
turtle.right(120)
turtle.forward(75)
turtle.right(60)
turtle.forward(300)
turtle.right(120)
turtle.forward(75)
turtle.right(150)
turtle.forward(100)
turtle.right(30)
turtle.forward(75)
turtle.left(120)
turtle.forward(300)
turtle.left(60)
turtle.forward(75)
turtle.left(120)
turtle.forw... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
539189bc34fac0ccbcd5cd2cd5682646c8fc21fa | 639 | py | Python | setup.py | elonhub/papers | 27636eadb6836b672301eaee64b61200fc89ed78 | [
"MIT"
] | 105 | 2018-05-25T20:45:34.000Z | 2022-03-30T05:10:18.000Z | setup.py | elonhub/papers | 27636eadb6836b672301eaee64b61200fc89ed78 | [
"MIT"
] | 18 | 2017-12-02T12:56:10.000Z | 2022-02-20T21:32:26.000Z | setup.py | perrette/myref | a7417ea82ebb296ef5517ea00e21e54b97a1ed78 | [
"MIT"
] | 23 | 2017-12-23T14:28:14.000Z | 2022-01-26T10:01:49.000Z | from distutils.core import setup
import versioneer
version = versioneer.get_version()
setup(name='papers-cli',
version=version,
cmdclass = versioneer.get_cmdclass(),
author='Mahe Perrette',
author_email='mahe.perrette@gmail.com',
description='utilities to keep your PDF library organized'... | 33.631579 | 93 | 0.671362 | from distutils.core import setup
import versioneer
version = versioneer.get_version()
setup(name='papers-cli',
version=version,
cmdclass = versioneer.get_cmdclass(),
author='Mahe Perrette',
author_email='mahe.perrette@gmail.com',
description='utilities to keep your PDF library organized'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f47952bf3243e98c7839fafda31165a7f8fed6ab | 2,929 | py | Python | pygears/common/cart.py | Risto97/pygears | 19393e85101a16762cb3bbbf3010946ef69217f2 | [
"MIT"
] | null | null | null | pygears/common/cart.py | Risto97/pygears | 19393e85101a16762cb3bbbf3010946ef69217f2 | [
"MIT"
] | null | null | null | pygears/common/cart.py | Risto97/pygears | 19393e85101a16762cb3bbbf3010946ef69217f2 | [
"MIT"
] | null | null | null |
# TODO: Lowest eot for each uncart output needs to be shortened to 1 data using
# flattening
| 26.387387 | 79 | 0.615227 | from pygears.core.gear import alternative, gear
from pygears.typing import Queue, Tuple, typeof
from pygears.common.shred import shred
from pygears.common.ccat import ccat
from pygears.util.utils import quiter_async
from pygears import module
def lvl_if_queue(t):
if not issubclass(t, Queue):
return 0
... | 0 | 2,000 | 0 | 0 | 0 | 401 | 0 | 111 | 315 |
6cce156e9dd815f900433f2cbb598128c23c884a | 2,357 | py | Python | parsedata_jhu.py | manar-c/covid19intexas | e1f69717aa8c6dbf1920fd771de0d9525e9e1bbb | [
"MIT"
] | null | null | null | parsedata_jhu.py | manar-c/covid19intexas | e1f69717aa8c6dbf1920fd771de0d9525e9e1bbb | [
"MIT"
] | null | null | null | parsedata_jhu.py | manar-c/covid19intexas | e1f69717aa8c6dbf1920fd771de0d9525e9e1bbb | [
"MIT"
] | null | null | null |
import pandas as pd
import numpy as np
#Goal: go through daily reports of JHU to get data for
# Texas, Travis, Harris, Dallas
baseurl = 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/'
#Start from March 1
#March 1 to March 21: jh only reported texas... | 26.483146 | 124 | 0.562155 |
import pandas as pd
import requests
import io
import numpy as np
#Goal: go through daily reports of JHU to get data for
# Texas, Travis, Harris, Dallas
baseurl = 'https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/'
#Start from March 1
#March 1 to March ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -18 | 44 |
5cecff2de7c350bc190f3cf7900410255d462c2e | 1,905 | py | Python | DeSSL/transforms/transform_many_times.py | Fragile-azalea/SSL-toolk | 4562901e5deb59605a9a191fe74adbb3de96bfc3 | [
"MIT"
] | 1 | 2021-12-15T02:32:30.000Z | 2021-12-15T02:32:30.000Z | DeSSL/transforms/transform_many_times.py | Fragile-azalea/SSL-toolkit | 4562901e5deb59605a9a191fe74adbb3de96bfc3 | [
"MIT"
] | null | null | null | DeSSL/transforms/transform_many_times.py | Fragile-azalea/SSL-toolkit | 4562901e5deb59605a9a191fe74adbb3de96bfc3 | [
"MIT"
] | null | null | null |
__all__ = ['ManyTimes', 'Twice']
| 25.065789 | 93 | 0.612073 | from typing import Callable
from torchvision import transforms as tf
from . import TRANSFORM_REGISTRY
__all__ = ['ManyTimes', 'Twice']
@TRANSFORM_REGISTRY.register
class IdentityAndManyTimes:
"""
This class changes an image to a normalized tensor image and a series of augmented image.
Args:
tra... | 0 | 1,696 | 0 | 0 | 0 | 0 | 0 | 36 | 135 |
ec11f7fd973b9babc2b655f4e09d0c98675c49fa | 379 | py | Python | netqasm/examples/apps/anonymous_transmission/app_charlie.py | Doomsk/netqasm | 5d6c6ad00c4e0f9ab0ec05518cfa827675f357e7 | [
"MIT"
] | 6 | 2021-11-10T15:03:59.000Z | 2022-02-16T19:35:01.000Z | netqasm/examples/apps/anonymous_transmission/app_charlie.py | Doomsk/netqasm | 5d6c6ad00c4e0f9ab0ec05518cfa827675f357e7 | [
"MIT"
] | 13 | 2021-11-26T09:19:46.000Z | 2022-03-29T09:21:42.000Z | netqasm/examples/apps/anonymous_transmission/app_charlie.py | Doomsk/netqasm | 5d6c6ad00c4e0f9ab0ec05518cfa827675f357e7 | [
"MIT"
] | 4 | 2021-11-19T15:46:17.000Z | 2022-01-23T18:59:15.000Z |
if __name__ == "__main__":
main()
| 15.791667 | 47 | 0.604222 | from src.protocol import anonymous_transmission
def main(
app_config=None,
sender=False,
receiver=False,
phi=0.0,
theta=0.0,
):
return anonymous_transmission(
app_name="charlie",
app_config=app_config,
sender=sender,
receiver=receiver,
phi=phi,
... | 0 | 0 | 0 | 0 | 0 | 267 | 0 | 26 | 45 |
6abd731b4559a3a3494ccf4ad0fee6c93e7f4f41 | 54,040 | py | Python | sklearn/feature_extraction/tests/test_text.py | LSturtew/scikit-learn | 5aecf201a3d9ee8896566a057b3a576f1e31d410 | [
"BSD-3-Clause"
] | 1 | 2021-11-27T08:04:53.000Z | 2021-11-27T08:04:53.000Z | sklearn/feature_extraction/tests/test_text.py | LSturtew/scikit-learn | 5aecf201a3d9ee8896566a057b3a576f1e31d410 | [
"BSD-3-Clause"
] | null | null | null | sklearn/feature_extraction/tests/test_text.py | LSturtew/scikit-learn | 5aecf201a3d9ee8896566a057b3a576f1e31d410 | [
"BSD-3-Clause"
] | 1 | 2021-11-03T09:49:02.000Z | 2021-11-03T09:49:02.000Z | # -*- coding: utf-8 -*-
import pytest
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from numpy.testing import assert_array_equal
JUNK_FOOD_DOCS = (
"the pizza pizza beer copyright",
"the pizza burger beer copyright",
"the the pizza... | 32.534618 | 88 | 0.657902 | # -*- coding: utf-8 -*-
from collections.abc import Mapping
import re
import pytest
from scipy import sparse
from sklearn.feature_extraction.text import strip_tags
from sklearn.feature_extraction.text import strip_accents_unicode
from sklearn.feature_extraction.text import strip_accents_ascii
from sklearn.feature_ex... | 385 | 25,087 | 0 | 0 | 0 | 23,778 | 0 | 537 | 2,161 |
ac47bb9a44cf37a97db3e576ed067939f6618234 | 108 | py | Python | processing/extraction/__init__.py | yashpatel5400/allercery | 09b201ea7f3a7ecf7393cb102f4bdebc780145c7 | [
"MIT"
] | null | null | null | processing/extraction/__init__.py | yashpatel5400/allercery | 09b201ea7f3a7ecf7393cb102f4bdebc780145c7 | [
"MIT"
] | null | null | null | processing/extraction/__init__.py | yashpatel5400/allercery | 09b201ea7f3a7ecf7393cb102f4bdebc780145c7 | [
"MIT"
] | null | null | null | """
__author__ = HackPrinceton 2017 Best Team
__description__ = Initializes files for extraction module
"""
| 21.6 | 57 | 0.787037 | """
__author__ = HackPrinceton 2017 Best Team
__description__ = Initializes files for extraction module
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
73c62dc035f06d89c56d3612826161e36082d017 | 5,149 | py | Python | src/openfermion/utils/__init__.py | Spaceenter/OpenFermion | c1bf76582ec94373333d95fc27d1b92248ba3efd | [
"Apache-2.0"
] | 3 | 2018-08-03T22:48:47.000Z | 2022-02-10T15:05:35.000Z | src/openfermion/utils/__init__.py | Spaceenter/OpenFermion | c1bf76582ec94373333d95fc27d1b92248ba3efd | [
"Apache-2.0"
] | null | null | null | src/openfermion/utils/__init__.py | Spaceenter/OpenFermion | c1bf76582ec94373333d95fc27d1b92248ba3efd | [
"Apache-2.0"
] | 1 | 2019-03-25T13:39:13.000Z | 2019-03-25T13:39:13.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | 45.566372 | 79 | 0.575257 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,085 | 435 |
eb9d2ce0896069df10b60597c4a04e16909f1f51 | 18,579 | py | Python | vespid/data/neo4j_tools/neo4j_arrow.py | QS-2/VESPID | f7d27f0c4aa99229d12d90fce9a52a48339e0a59 | [
"Apache-2.0"
] | 16 | 2021-09-11T11:16:05.000Z | 2022-03-14T23:09:17.000Z | vespid/data/neo4j_tools/neo4j_arrow.py | QS-2/VESPID | f7d27f0c4aa99229d12d90fce9a52a48339e0a59 | [
"Apache-2.0"
] | 6 | 2021-09-24T23:17:28.000Z | 2022-02-15T21:18:31.000Z | vespid/data/neo4j_tools/neo4j_arrow.py | QS-2/VESPID | f7d27f0c4aa99229d12d90fce9a52a48339e0a59 | [
"Apache-2.0"
] | 1 | 2022-02-22T14:44:21.000Z | 2022-02-22T14:44:21.000Z | from os import environ as env
from typing import cast, Any, Dict, TypeVar, Union
import pyarrow as pa
from pyarrow.lib import RecordBatch, Table
import pyarrow.flight as flight
# Known job types supported by the Java plugin.
_JOB_BULK_IMPORT = "import.bulk"
_JOB_CYPHER = "cypher.read"
_JOB_GDS_READ = "gds.read" # TO... | 39.698718 | 88 | 0.591097 | import base64
import json
import struct
from collections import abc
from enum import Enum
from os import environ as env
from time import sleep, time
from typing import cast, Any, Dict, Iterable, Iterator, List, Optional, \
Tuple, TypeVar, Union
import pyarrow as pa
from pyarrow.lib import ArrowKeyError, RecordBatc... | 0 | 167 | 0 | 16,143 | 0 | 0 | 0 | 59 | 178 |
9bcd3d00f356e0a72c632ddcd420f05a25d61fab | 86 | py | Python | Data Scientist Career Path/3. Python Fundamentals/9. Python Classes/1. types.py | myarist/Codecademy | 2ba0f104bc67ab6ef0f8fb869aa12aa02f5f1efb | [
"MIT"
] | 23 | 2021-06-06T15:35:55.000Z | 2022-03-21T06:53:42.000Z | Data Scientist Career Path/3. Python Fundamentals/9. Python Classes/1. types.py | shivaniverma1/Data-Scientist | f82939a411484311171465591455880c8e354750 | [
"MIT"
] | null | null | null | Data Scientist Career Path/3. Python Fundamentals/9. Python Classes/1. types.py | shivaniverma1/Data-Scientist | f82939a411484311171465591455880c8e354750 | [
"MIT"
] | 9 | 2021-06-08T01:32:04.000Z | 2022-03-18T15:38:09.000Z | print(type(5))
my_dict = {}
print(type(my_dict))
my_list = []
print(type(my_list)) | 9.555556 | 20 | 0.651163 | print(type(5))
my_dict = {}
print(type(my_dict))
my_list = []
print(type(my_list)) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5215ed9f3a1e89f1da086e79b175848d870140fb | 6,443 | py | Python | tests/test_util.py | luminantdata/great_expectations | f4b15d20a092fcbef690506f89bddec84b8140ff | [
"Apache-2.0"
] | null | null | null | tests/test_util.py | luminantdata/great_expectations | f4b15d20a092fcbef690506f89bddec84b8140ff | [
"Apache-2.0"
] | null | null | null | tests/test_util.py | luminantdata/great_expectations | f4b15d20a092fcbef690506f89bddec84b8140ff | [
"Apache-2.0"
] | null | null | null | import unittest
if __name__ == "__main__":
unittest.main() | 45.055944 | 167 | 0.652491 | import json
import datetime
import numpy as np
import unittest
import great_expectations as ge
class TestUtilMethods(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(TestUtilMethods, self).__init__(*args, **kwargs)
self.D = ge.read_csv('./tests/test_sets/distributional_expectations_d... | 0 | 0 | 0 | 6,275 | 0 | 0 | 0 | -9 | 112 |
d34b7bb0460a5a77dc69b2aa8301f3c06d1946f8 | 498 | py | Python | misc2_host_device_data_transfer.py | zfang92/pedagogical_cuda_code | 1bc78d575c8d93c8906f361a1d980086fe11a9d1 | [
"MIT"
] | null | null | null | misc2_host_device_data_transfer.py | zfang92/pedagogical_cuda_code | 1bc78d575c8d93c8906f361a1d980086fe11a9d1 | [
"MIT"
] | null | null | null | misc2_host_device_data_transfer.py | zfang92/pedagogical_cuda_code | 1bc78d575c8d93c8906f361a1d980086fe11a9d1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Zheng Fang
"""
import numpy as np
n = int(2e4) # this is not to exceed 10^7
# supply data
data = np.random.normal(size=n, loc=0, scale=1).astype('float64')
# define convenience function
#======================================================================... | 16.6 | 72 | 0.502008 | # -*- coding: utf-8 -*-
"""
@author: Zheng Fang
"""
from numba import cuda
import numpy as np
n = int(2e4) # this is not to exceed 10^7
# supply data
data = np.random.normal(size=n, loc=0, scale=1).astype('float64')
# define convenience function
def timer():
d_data = cuda.to_device(data)
... | 0 | 0 | 0 | 0 | 0 | 53 | 0 | 1 | 48 |
77f31cd5ae12bdbd070064c80b7616ce1824e4c6 | 15,156 | py | Python | py/garage/garage/collections.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | 3 | 2016-01-04T06:28:52.000Z | 2020-09-20T13:18:40.000Z | py/garage/garage/collections.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | py/garage/garage/collections.py | clchiou/garage | 446ff34f86cdbd114b09b643da44988cf5d027a3 | [
"MIT"
] | null | null | null | """Collections of objects and collection helper functions."""
__all__ = [
'BiDict',
'DictBuilder',
'DictView',
'LoadingDict',
'LruCache',
'NamedTuple',
'SingletonMeta',
'Symbols',
'Trie',
'collect',
'collect_pairs',
'group',
'is_ordered',
'unique',
]
import oper... | 29.659491 | 78 | 0.571391 | """Collections of objects and collection helper functions."""
__all__ = [
'BiDict',
'DictBuilder',
'DictView',
'LoadingDict',
'LruCache',
'NamedTuple',
'SingletonMeta',
'Symbols',
'Trie',
'collect',
'collect_pairs',
'group',
'is_ordered',
'unique',
]
import oper... | 0 | 1,420 | 0 | 11,802 | 0 | 0 | 0 | 69 | 253 |
d40ceb086f0dfeadaad0a4a4e7992e8865fb8f3a | 3,831 | py | Python | mpsci/distributions/invchi2.py | WarrenWeckesser/mpsci | 675f0f3b76700529558a3bae2a1b2ca09552233b | [
"BSD-2-Clause"
] | 7 | 2019-03-27T17:25:41.000Z | 2022-03-31T03:55:29.000Z | mpsci/distributions/invchi2.py | WarrenWeckesser/mpsci | 675f0f3b76700529558a3bae2a1b2ca09552233b | [
"BSD-2-Clause"
] | 2 | 2019-05-09T16:09:45.000Z | 2021-01-04T03:55:09.000Z | mpsci/distributions/invchi2.py | WarrenWeckesser/mpsci | 675f0f3b76700529558a3bae2a1b2ca09552233b | [
"BSD-2-Clause"
] | null | null | null | """
Inverse chi-square distribution
-------------------------------
The probability density function for the inverse chi-square
distribution is
f(x, nu) = 2**(-nu/2) / Gamma(nu/2) * x**(-nu/2 - 1) * exp(-1/(2*x))
See the Wikipedia article `"Inverse-chi-squared distribution"
<https://en.wikipedia.org/wiki/Inverse... | 23.648148 | 76 | 0.527539 | """
Inverse chi-square distribution
-------------------------------
The probability density function for the inverse chi-square
distribution is
f(x, nu) = 2**(-nu/2) / Gamma(nu/2) * x**(-nu/2 - 1) * exp(-1/(2*x))
See the Wikipedia article `"Inverse-chi-squared distribution"
<https://en.wikipedia.org/wiki/Inverse... | 0 | 0 | 0 | 0 | 0 | 64 | 0 | 0 | 23 |
026118a250d1c4f591023f554e6cd2e4aca62694 | 3,562 | py | Python | traffic_test.py | yuecong/tools | 1d3f63e579c75c28d49d0f805e517bbb564e50ef | [
"MIT"
] | null | null | null | traffic_test.py | yuecong/tools | 1d3f63e579c75c28d49d0f805e517bbb564e50ef | [
"MIT"
] | null | null | null | traffic_test.py | yuecong/tools | 1d3f63e579c75c28d49d0f805e517bbb564e50ef | [
"MIT"
] | null | null | null | #!/usr/bin/python
import psutil
import subprocess
import simplejson
import time
import random
import multiprocessing as mp
procs_id = 0
procs = {}
procs_data = []
url_num = 0
# Define an output queue
output = mp.Queue()
MAX_THREAD_NUM = 500
#proxy_url='10.0.0.204:80'
proxy_url=''
urls = [
'http://drbd.linbit.c... | 27.612403 | 103 | 0.616227 | #!/usr/bin/python
import psutil
import subprocess
import simplejson
import time
import random
import multiprocessing as mp
procs_id = 0
procs = {}
procs_data = []
url_num = 0
# Define an output queue
output = mp.Queue()
MAX_THREAD_NUM = 500
#proxy_url='10.0.0.204:80'
proxy_url=''
urls = [
'http://drbd.linbit.c... | 0 | 0 | 0 | 0 | 0 | 1,636 | 0 | 0 | 67 |
103b8401e6645a543a140fb6594e4acf25b6699c | 1,890 | py | Python | scrap_app_info.py | jahangir091/app-data-collection | 7ac87328c896225396d020b06ca3a4a8d9b9a8a5 | [
"MIT"
] | null | null | null | scrap_app_info.py | jahangir091/app-data-collection | 7ac87328c896225396d020b06ca3a4a8d9b9a8a5 | [
"MIT"
] | null | null | null | scrap_app_info.py | jahangir091/app-data-collection | 7ac87328c896225396d020b06ca3a4a8d9b9a8a5 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup as soup
import os
output_filename = "output_files/slideshow/app_info/app_info.csv"
output_file = open(output_filename, "a")
headers = "title, subtitle, publisher, country, year, last_month_downloads, last_month_revenue\n"
output_file.write(headers)
for filename in os.listdir(os.getcwd... | 51.081081 | 174 | 0.609524 | from bs4 import BeautifulSoup as soup
import os
output_filename = "output_files/slideshow/app_info/app_info.csv"
output_file = open(output_filename, "a")
headers = "title, subtitle, publisher, country, year, last_month_downloads, last_month_revenue\n"
output_file.write(headers)
def clean_value(value):
if not va... | 0 | 0 | 0 | 0 | 0 | 68 | 0 | 0 | 23 |
8c1a23a66f3673146f1b7adcf6ca82eae41a4398 | 15,048 | py | Python | mmdb_writer.py | VimT/MaxMind-DB-Writer-python | edd4790c76bad6ae68b7dd621d1e0d64ea11fa07 | [
"MIT"
] | 6 | 2021-01-09T01:01:32.000Z | 2022-01-25T16:26:43.000Z | mmdb_writer.py | VimT/MaxMind-DB-Writer-python | edd4790c76bad6ae68b7dd621d1e0d64ea11fa07 | [
"MIT"
] | 1 | 2020-12-25T18:02:33.000Z | 2020-12-25T22:25:48.000Z | mmdb_writer.py | VimT/MaxMind-DB-Writer-python | edd4790c76bad6ae68b7dd621d1e0d64ea11fa07 | [
"MIT"
] | 4 | 2020-11-22T16:07:24.000Z | 2022-02-05T20:31:35.000Z | # coding: utf-8
__version__ = '0.1.0'
import logging
from typing import Union
MMDBType = Union[dict, list, str, bytes, int, bool]
logger = logging.getLogger(__name__)
METADATA_MAGIC = b'\xab\xcd\xefMaxMind.com'
| 33.072527 | 110 | 0.54592 | # coding: utf-8
__version__ = '0.1.0'
import logging
import math
import struct
import time
from typing import Union
from netaddr import IPSet
MMDBType = Union[dict, list, str, bytes, int, bool]
logger = logging.getLogger(__name__)
METADATA_MAGIC = b'\xab\xcd\xefMaxMind.com'
class SearchTreeNode(object):
def ... | 0 | 905 | 0 | 13,642 | 0 | 77 | 0 | -24 | 227 |
136757bc6d8a0fcd893778d2fdb833985e51bbd6 | 62,849 | py | Python | src/command_modules/azure-cli-network/azure/cli/command_modules/network/_validators.py | ehotinger/azure-cli | 4652cddd711bf96f54f9d3a870d3e48e0184db31 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-network/azure/cli/command_modules/network/_validators.py | ehotinger/azure-cli | 4652cddd711bf96f54f9d3a870d3e48e0184db31 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-network/azure/cli/command_modules/network/_validators.py | ehotinger/azure-cli | 4652cddd711bf96f54f9d3a870d3e48e0184db31 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 41.293693 | 154 | 0.68803 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 0 | 0 | 0 | 791 | 0 | 58,186 | 0 | 317 | 2,118 |