hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f725d592ba2435c4281618ab5b9e73df3f162b9f | 4,779 | py | Python | tests/test_moments.py | nextBillyonair/DPM | 840ffaafe15c208b200b74094ffa8fe493b4c975 | [
"MIT"
] | 1 | 2021-07-20T14:02:55.000Z | 2021-07-20T14:02:55.000Z | tests/test_moments.py | nextBillyonair/DPM | 840ffaafe15c208b200b74094ffa8fe493b4c975 | [
"MIT"
] | null | null | null | tests/test_moments.py | nextBillyonair/DPM | 840ffaafe15c208b200b74094ffa8fe493b4c975 | [
"MIT"
] | null | null | null | import pytest
from dpm.distributions import *
import dpm.utils as utils
import torch
def test_arcsine():
model = Arcsine()
assert model.expectation == 0.5
assert model.median == 0.5
assert model.variance == 0.125
assert model.skewness == 0.
assert model.kurtosis == -1.5
model = Arcsine(-1... | 27.624277 | 96 | 0.628793 | import pytest
from dpm.distributions import *
import dpm.utils as utils
import torch
def test_arcsine():
model = Arcsine()
assert model.expectation == 0.5
assert model.median == 0.5
assert model.variance == 0.125
assert model.skewness == 0.
assert model.kurtosis == -1.5
model = Arcsine(-1... | true | true |
f725d77804443400285175fcae23883c61714c8f | 2,450 | py | Python | app.py | pythonpad/brython-runner-stdin-hanger | 8ee3b13fba3ff2eabbaf39835b6aa9bd7692589d | [
"MIT"
] | 1 | 2020-11-16T09:21:31.000Z | 2020-11-16T09:21:31.000Z | app.py | pythonpad/brython-runner-stdin-hanger | 8ee3b13fba3ff2eabbaf39835b6aa9bd7692589d | [
"MIT"
] | null | null | null | app.py | pythonpad/brython-runner-stdin-hanger | 8ee3b13fba3ff2eabbaf39835b6aa9bd7692589d | [
"MIT"
] | null | null | null | import asyncio
import sys
import random
import string
from aiohttp import web
def get_random_string(k=16):
return ''.join(random.choices(string.ascii_lowercase + string.digits, k=k))
class Handler:
def __init__(self):
self.store = {}
self.headers = {'Access-Control-Allow-Origin': '*'}
as... | 31.012658 | 79 | 0.579184 | import asyncio
import sys
import random
import string
from aiohttp import web
def get_random_string(k=16):
return ''.join(random.choices(string.ascii_lowercase + string.digits, k=k))
class Handler:
def __init__(self):
self.store = {}
self.headers = {'Access-Control-Allow-Origin': '*'}
as... | true | true |
f725d78e5277a65d26773130068149604e4a2536 | 15,850 | py | Python | gs_quant/test/timeseries/test_datetime.py | skyquant2/gs-quant | b7e648fa7912b13ad1fd503b643389e34587aa1e | [
"Apache-2.0"
] | 1 | 2021-06-28T06:43:42.000Z | 2021-06-28T06:43:42.000Z | gs_quant/test/timeseries/test_datetime.py | skyquant2/gs-quant | b7e648fa7912b13ad1fd503b643389e34587aa1e | [
"Apache-2.0"
] | null | null | null | gs_quant/test/timeseries/test_datetime.py | skyquant2/gs-quant | b7e648fa7912b13ad1fd503b643389e34587aa1e | [
"Apache-2.0"
] | null | null | null | """
Copyright 2018 Goldman Sachs.
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 di... | 34.835165 | 115 | 0.617603 |
import pytest
from pandas.testing import assert_series_equal
from gs_quant.timeseries.datetime import *
def test_align():
dates1 = [
date(2019, 1, 1),
date(2019, 1, 2),
date(2019, 1, 3),
date(2019, 1, 4),
date(2019, 1, 5),
]
dates2 = [
date(2019, 1, 2),
... | true | true |
f725d794e1c2ea3a0dadaac39e0ba98d95db8820 | 11,101 | py | Python | components/mpas-seaice/testing_and_setup/forcing/create_ocean_forcing.py | Fa-Li/E3SM | a91995093ec6fc0dd6e50114f3c70b5fb64de0f0 | [
"zlib-acknowledgement",
"FTL",
"RSA-MD"
] | 235 | 2018-04-23T16:30:06.000Z | 2022-03-21T17:53:12.000Z | components/mpas-seaice/testing_and_setup/forcing/create_ocean_forcing.py | Fa-Li/E3SM | a91995093ec6fc0dd6e50114f3c70b5fb64de0f0 | [
"zlib-acknowledgement",
"FTL",
"RSA-MD"
] | 2,372 | 2018-04-20T18:12:34.000Z | 2022-03-31T23:43:17.000Z | components/mpas-seaice/testing_and_setup/forcing/create_ocean_forcing.py | Fa-Li/E3SM | a91995093ec6fc0dd6e50114f3c70b5fb64de0f0 | [
"zlib-acknowledgement",
"FTL",
"RSA-MD"
] | 254 | 2018-04-20T20:43:32.000Z | 2022-03-30T20:13:38.000Z | from __future__ import print_function
from netCDF4 import Dataset
import netCDF4
import numpy as np
import os
import sys
import ConfigParser
import math
from scipy.interpolate import griddata
from create_forcing import create_scrip_grid_file, get_mpas_grid_info, create_scrip_file_MPAS, write_scrip_in_file, create_outpu... | 30.836111 | 155 | 0.602198 | from __future__ import print_function
from netCDF4 import Dataset
import netCDF4
import numpy as np
import os
import sys
import ConfigParser
import math
from scipy.interpolate import griddata
from create_forcing import create_scrip_grid_file, get_mpas_grid_info, create_scrip_file_MPAS, write_scrip_in_file, create_outpu... | true | true |
f725d7bce110226cd80cad4c972a9de2caa719fe | 1,365 | py | Python | hammerd/hammertests/hammertests_control_tp.py | emersion/chromiumos-platform2 | ba71ad06f7ba52e922c647a8915ff852b2d4ebbd | [
"BSD-3-Clause"
] | 5 | 2019-01-19T15:38:48.000Z | 2021-10-06T03:59:46.000Z | hammerd/hammertests/hammertests_control_tp.py | emersion/chromiumos-platform2 | ba71ad06f7ba52e922c647a8915ff852b2d4ebbd | [
"BSD-3-Clause"
] | null | null | null | hammerd/hammertests/hammertests_control_tp.py | emersion/chromiumos-platform2 | ba71ad06f7ba52e922c647a8915ff852b2d4ebbd | [
"BSD-3-Clause"
] | 1 | 2019-02-15T23:05:30.000Z | 2019-02-15T23:05:30.000Z | #!/usr/bin/env python2
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Control file for the following tests
rb_protection.py
'''
from __future__ import print_function
import os
import shutil
im... | 29.673913 | 73 | 0.519414 |
from __future__ import print_function
import os
import shutil
import sys
def main(argv):
if len(argv) > 0:
sys.exit('Test takes no args!')
iterations = 1
output_to_stdout = ' 2>&1 | tee '
python_prefix = 'python '
test_list = ['transfer_touchpad_works']
for test in test_list:
logs_dir = 'l... | true | true |
f725d8c9c18f752a5eb6f5c8c45f1e57f22267b2 | 2,782 | py | Python | AddSampleSheetBackPage.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | 1 | 2017-05-24T02:05:20.000Z | 2017-05-24T02:05:20.000Z | AddSampleSheetBackPage.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | null | null | null | AddSampleSheetBackPage.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | null | null | null | from PyPDF2 import PdfFileMerger
import operator
import os
def fileMerge(district, sorted_fileDict):
'''Creates a list of files to be exported for each district'''
print "Creating Bound PDF for %s District" % district
# Add path to the individual sample sheets
sampleSheetPath = "T:\\DATAMGT\\HPMS-DATA... | 39.742857 | 170 | 0.658519 | from PyPDF2 import PdfFileMerger
import operator
import os
def fileMerge(district, sorted_fileDict):
'''Creates a list of files to be exported for each district'''
print "Creating Bound PDF for %s District" % district
sampleSheetPath = "T:\\DATAMGT\\HPMS-DATA\\2013Data\\2013 Sample Sheets\\PDFs\\PDFs... | false | true |
f725d8d28b3442d977bd49f6e51ed9adcdb15b84 | 698 | py | Python | GMX_TEST/DIP/DIFF.py | leelasd/OPLS-AAM_for_Gromacs | 50ff268525e9177e46175fdb122276c0045f1dab | [
"MIT"
] | 6 | 2017-10-14T10:10:51.000Z | 2020-12-11T15:19:39.000Z | GMX_TEST/DIP/DIFF.py | leelasd/OPLS-AAM_for_Gromacs | 50ff268525e9177e46175fdb122276c0045f1dab | [
"MIT"
] | 1 | 2019-06-18T20:37:23.000Z | 2019-06-18T20:37:23.000Z | GMX_TEST/DIP/DIFF.py | leelasd/OPLS-AAM_for_Gromacs | 50ff268525e9177e46175fdb122276c0045f1dab | [
"MIT"
] | 3 | 2020-07-10T10:41:58.000Z | 2021-11-14T19:30:05.000Z | import os
from collections import OrderedDict
import sys
fil = open('energy.xvg').readlines()
GMX_dat = [float(f)/4.184 for f in fil[-1].split()[1:-1]]
nfil = open('LOG_NAMD').readlines()
for line in nfil:
if 'ENERGY: 200' in line:
NAMD_DAT = [float(f) for f in line.split()[2:12]]
print(NAMD_DAT)
p... | 36.736842 | 61 | 0.661891 | import os
from collections import OrderedDict
import sys
fil = open('energy.xvg').readlines()
GMX_dat = [float(f)/4.184 for f in fil[-1].split()[1:-1]]
nfil = open('LOG_NAMD').readlines()
for line in nfil:
if 'ENERGY: 200' in line:
NAMD_DAT = [float(f) for f in line.split()[2:12]]
print(NAMD_DAT)
p... | true | true |
f725d93f74485f2e2384998211087edd14cd10b4 | 1,223 | py | Python | comment/serializers.py | vahidtwo/simpleSocialSite | 40d971f04b7127811b7e277ddb3068fb451e9574 | [
"MIT"
] | 1 | 2020-05-16T16:14:51.000Z | 2020-05-16T16:14:51.000Z | comment/serializers.py | vahidtwo/simpleSocialSite | 40d971f04b7127811b7e277ddb3068fb451e9574 | [
"MIT"
] | 5 | 2021-03-18T23:21:18.000Z | 2022-01-13T02:10:19.000Z | comment/serializers.py | vahidtwo/simpleSocialSite | 40d971f04b7127811b7e277ddb3068fb451e9574 | [
"MIT"
] | null | null | null | from django.db.models import Sum
from rest_framework import serializers
from like.models import Like
from .models import Comment
from accounts.serializers import UserSerializer
class CommentSerializer(serializers.ModelSerializer):
owner = UserSerializer(read_only=True)
like = serializers.SerializerMethodField()
d... | 31.358974 | 100 | 0.739166 | from django.db.models import Sum
from rest_framework import serializers
from like.models import Like
from .models import Comment
from accounts.serializers import UserSerializer
class CommentSerializer(serializers.ModelSerializer):
owner = UserSerializer(read_only=True)
like = serializers.SerializerMethodField()
d... | true | true |
f725d9770174732322b6fe8380b521e22d1f1a54 | 5,699 | py | Python | qa/rpc-tests/test_framework/socks5.py | kileer/monix | 86525601d5915f380976c9d2e686ad7f66db991f | [
"MIT"
] | 174 | 2018-01-16T13:26:52.000Z | 2022-02-16T15:12:10.000Z | qa/rpc-tests/test_framework/socks5.py | kileer/monix | 86525601d5915f380976c9d2e686ad7f66db991f | [
"MIT"
] | 32 | 2018-01-25T03:42:01.000Z | 2020-07-31T17:37:52.000Z | qa/rpc-tests/test_framework/socks5.py | kileer/monix | 86525601d5915f380976c9d2e686ad7f66db991f | [
"MIT"
] | 78 | 2017-05-26T15:23:40.000Z | 2021-07-07T10:47:37.000Z | # Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Dummy Socks5 server for testing.
'''
from __future__ import print_function, division, unicode_literals
import socket, threading, Q... | 35.397516 | 125 | 0.572732 |
from __future__ import print_function, division, unicode_literals
import socket, threading, Queue
import traceback, sys
AddressType:
IPV4 = 0x01
DOMAINNAME = 0x03
IPV6 = 0x04
)
while n > 0:
d = s.recv(n)
if not d:
raise IOError('Unexpected end of stream')
rv.ext... | true | true |
f725d9b75a08ba36d8046190c73a204e849ad713 | 6,589 | py | Python | clpipe/fmri_preprocess.py | keithcallenberg/clpipe | da1120bdcf820ba922c0a72792024007b232428c | [
"MIT"
] | 10 | 2019-02-06T19:32:49.000Z | 2022-02-01T20:41:05.000Z | clpipe/fmri_preprocess.py | keithcallenberg/clpipe | da1120bdcf820ba922c0a72792024007b232428c | [
"MIT"
] | 96 | 2019-02-06T17:10:59.000Z | 2022-03-30T19:08:49.000Z | clpipe/fmri_preprocess.py | keithcallenberg/clpipe | da1120bdcf820ba922c0a72792024007b232428c | [
"MIT"
] | 6 | 2020-06-26T18:51:59.000Z | 2021-09-16T06:55:04.000Z | import os
import click
import sys
import logging
from .batch_manager import BatchManager, Job
from .config_json_parser import ClpipeConfigParser
from .error_handler import exception_handler
@click.command()
@click.argument('subjects', nargs=-1, required=False, default=None)
@click.option('-config_file', type=click.Pa... | 59.9 | 184 | 0.682805 | import os
import click
import sys
import logging
from .batch_manager import BatchManager, Job
from .config_json_parser import ClpipeConfigParser
from .error_handler import exception_handler
@click.command()
@click.argument('subjects', nargs=-1, required=False, default=None)
@click.option('-config_file', type=click.Pa... | true | true |
f725db44f7c222d549edd398c8d51bd4cea4c003 | 2,788 | py | Python | db/tpl.py | iamaguoke/qiandao | a60b99ceb7c22a6dcec14621c00a4c1a7c02e940 | [
"MIT"
] | 40 | 2021-07-29T18:31:28.000Z | 2022-03-28T12:56:11.000Z | db/tpl.py | iamaguoke/qiandao | a60b99ceb7c22a6dcec14621c00a4c1a7c02e940 | [
"MIT"
] | 35 | 2021-08-20T03:47:54.000Z | 2022-02-26T12:36:11.000Z | db/tpl.py | iamaguoke/qiandao | a60b99ceb7c22a6dcec14621c00a4c1a7c02e940 | [
"MIT"
] | 12 | 2021-08-01T12:55:51.000Z | 2022-03-19T11:11:48.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-08-07 22:27:07
import time
import config
from .basedb import BaseDB
class TPLDB(BaseDB):
'''
tpl db
id, userid, siteurl, sitename, banne... | 36.207792 | 137 | 0.571019 |
import time
import config
from .basedb import BaseDB
class TPLDB(BaseDB):
__tablename__ = 'tpl'
def __init__(self, host=config.mysql.host, port=config.mysql.port,
database=config.mysql.database, user=config.mysql.user, passwd=config.mysql.passwd, auth_plugin=config.mysql.auth_plugin):
... | true | true |
f725db70338fae233d3d7b81bce2649a1d1b3d56 | 1,745 | py | Python | airflow/providers/google/cloud/example_dags/example_local_to_gcs.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 15,947 | 2019-01-05T13:51:02.000Z | 2022-03-31T23:33:16.000Z | airflow/providers/google/cloud/example_dags/example_local_to_gcs.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 14,603 | 2019-01-05T09:43:19.000Z | 2022-03-31T23:11:59.000Z | airflow/providers/google/cloud/example_dags/example_local_to_gcs.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 8,429 | 2019-01-05T19:45:47.000Z | 2022-03-31T22:13:01.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 38.777778 | 99 | 0.773066 |
import os
from airflow import models
from airflow.providers.google.cloud.transfers.local_to_gcs import LocalFilesystemToGCSOperator
from airflow.utils import dates
BUCKET_NAME = os.environ.get('GCP_GCS_BUCKET', 'example-bucket-name')
PATH_TO_UPLOAD_FILE = os.environ.get('GCP_GCS_PATH_TO_UPLOAD_FILE... | true | true |
f725dc18c0de850fd97c348c18d72de36f535c2c | 972 | py | Python | main.py | minkowski0125/multilayer-gcn-simulation | 15a4cd29d819246549148e3a32c99f3b8589f3b4 | [
"MIT"
] | null | null | null | main.py | minkowski0125/multilayer-gcn-simulation | 15a4cd29d819246549148e3a32c99f3b8589f3b4 | [
"MIT"
] | null | null | null | main.py | minkowski0125/multilayer-gcn-simulation | 15a4cd29d819246549148e3a32c99f3b8589f3b4 | [
"MIT"
] | null | null | null | import json
from utils import *
from config import args
from train import train
from torch.utils.tensorboard import SummaryWriter
if __name__ == '__main__':
set_seed(args.seed)
series = []
if args.dataset == 'pubmed':
graphs, features, adjs, labels = load_pubmed_data({
'deg_num': args.... | 30.375 | 182 | 0.609053 | import json
from utils import *
from config import args
from train import train
from torch.utils.tensorboard import SummaryWriter
if __name__ == '__main__':
set_seed(args.seed)
series = []
if args.dataset == 'pubmed':
graphs, features, adjs, labels = load_pubmed_data({
'deg_num': args.... | true | true |
f725dc7d2c733d4a8ac8fe71d0f7b4f4d8da1077 | 292 | py | Python | camping_server2/bot/slackbot.py | solyourock/crawling_project | 068525f299eb180d46f1537ee2a02648bbec61ec | [
"MIT"
] | null | null | null | camping_server2/bot/slackbot.py | solyourock/crawling_project | 068525f299eb180d46f1537ee2a02648bbec61ec | [
"MIT"
] | null | null | null | camping_server2/bot/slackbot.py | solyourock/crawling_project | 068525f299eb180d46f1537ee2a02648bbec61ec | [
"MIT"
] | null | null | null | import requests, json
import camping_server2.config as config
class IncomingWebhook:
def send_msg(err_msg):
payload = {"channel": "dss17", "username": "bot", "text": err_msg}
response = requests.post(config.Config.WEBHOOK_URL, json.dumps(payload))
print(response) | 36.5 | 80 | 0.69863 | import requests, json
import camping_server2.config as config
class IncomingWebhook:
def send_msg(err_msg):
payload = {"channel": "dss17", "username": "bot", "text": err_msg}
response = requests.post(config.Config.WEBHOOK_URL, json.dumps(payload))
print(response) | true | true |
f725dcd14f6c8b71ba1fb843294a5688b1583471 | 26,344 | py | Python | python/pyvw.py | alinabi/vowpal_wabbit | 518513e2023676f060f045ddb751fc1a5e0b7eb2 | [
"BSD-3-Clause"
] | 1 | 2021-07-06T20:02:44.000Z | 2021-07-06T20:02:44.000Z | python/pyvw.py | alinabi/vowpal_wabbit | 518513e2023676f060f045ddb751fc1a5e0b7eb2 | [
"BSD-3-Clause"
] | null | null | null | python/pyvw.py | alinabi/vowpal_wabbit | 518513e2023676f060f045ddb751fc1a5e0b7eb2 | [
"BSD-3-Clause"
] | null | null | null | import sys
import pylibvw
class SearchTask():
def __init__(self, vw, sch, num_actions):
self.vw = vw
self.sch = sch
self.blank_line = self.vw.example("")
self.blank_line.finish()
self.bogus_example = self.vw.example("1 | x")
def __del__(self):
self.bogus_example... | 43.186885 | 238 | 0.602984 | import sys
import pylibvw
class SearchTask():
def __init__(self, vw, sch, num_actions):
self.vw = vw
self.sch = sch
self.blank_line = self.vw.example("")
self.blank_line.finish()
self.bogus_example = self.vw.example("1 | x")
def __del__(self):
self.bogus_example... | true | true |
f725dd2723a8f6af9c7f472d8dd8cc02232f81ab | 5,239 | py | Python | src/backend/tests/models/test_record_summarizer.py | Ark20/recordexpungPDX | 2b76b3f5284e8ce572942cc58c9a4577442036fe | [
"MIT"
] | null | null | null | src/backend/tests/models/test_record_summarizer.py | Ark20/recordexpungPDX | 2b76b3f5284e8ce572942cc58c9a4577442036fe | [
"MIT"
] | null | null | null | src/backend/tests/models/test_record_summarizer.py | Ark20/recordexpungPDX | 2b76b3f5284e8ce572942cc58c9a4577442036fe | [
"MIT"
] | null | null | null | from expungeservice.models.disposition import DispositionCreator
from expungeservice.record_merger import RecordMerger
from expungeservice.record_summarizer import RecordSummarizer
from expungeservice.expunger import Expunger
from expungeservice.models.record import Record
from tests.factories.case_factory import CaseF... | 34.24183 | 118 | 0.564993 | from expungeservice.models.disposition import DispositionCreator
from expungeservice.record_merger import RecordMerger
from expungeservice.record_summarizer import RecordSummarizer
from expungeservice.expunger import Expunger
from expungeservice.models.record import Record
from tests.factories.case_factory import CaseF... | true | true |
f725dd3b8236c64cc62c4c8f8e6178ceb94eea3c | 32 | py | Python | packages/w3af/w3af/plugins/tests/output/test_console.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | 3 | 2019-04-09T22:59:33.000Z | 2019-06-14T09:23:24.000Z | tools/w3af/w3af/plugins/tests/output/test_console.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | null | null | null | tools/w3af/w3af/plugins/tests/output/test_console.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | null | null | null | """
@see: test_consoleui.py
"""
| 8 | 23 | 0.59375 | true | true | |
f725dd3e3ae97ac6d8f564d676e5f24bde3c982a | 486 | py | Python | FileStorage/sf_file/urls.py | Thiefxt/FileStorage | db2882b2ea861f4412cb453edef6439501b13705 | [
"MIT"
] | 1 | 2020-07-15T10:02:40.000Z | 2020-07-15T10:02:40.000Z | FileStorage/sf_file/urls.py | Thiefxt/FileStorage | db2882b2ea861f4412cb453edef6439501b13705 | [
"MIT"
] | null | null | null | FileStorage/sf_file/urls.py | Thiefxt/FileStorage | db2882b2ea861f4412cb453edef6439501b13705 | [
"MIT"
] | null | null | null | """
@Author : xiaotao
@Email : 18773993654@163.com
@Lost modifid : 2020/4/24 10:06
@Filename : urls.py
@Description :
@Software : PyCharm
"""
from django.urls import path
from sf_file.views import file_management
urlpatterns = [
path("test", file_management.Test.as_view()), ... | 25.578947 | 114 | 0.520576 | from django.urls import path
from sf_file.views import file_management
urlpatterns = [
path("test", file_management.Test.as_view()),
path("upload", file_management.FileUpload.as_view()),
]
| true | true |
f725ddb7c782aa8c33226416d2d64b83c212aa9f | 13,370 | py | Python | cime/scripts/lib/CIME/XML/machines.py | cjvogl/E3SM | d8990bc2efda76b6f9096f989eed46bd3ab87463 | [
"FTL",
"zlib-acknowledgement",
"RSA-MD"
] | 1 | 2019-12-11T16:41:13.000Z | 2019-12-11T16:41:13.000Z | cime/scripts/lib/CIME/XML/machines.py | cjvogl/E3SM | d8990bc2efda76b6f9096f989eed46bd3ab87463 | [
"FTL",
"zlib-acknowledgement",
"RSA-MD"
] | null | null | null | cime/scripts/lib/CIME/XML/machines.py | cjvogl/E3SM | d8990bc2efda76b6f9096f989eed46bd3ab87463 | [
"FTL",
"zlib-acknowledgement",
"RSA-MD"
] | null | null | null | """
Interface to the config_machines.xml file. This class inherits from GenericXML.py
"""
from CIME.XML.standard_module_setup import *
from CIME.XML.generic_xml import GenericXML
from CIME.XML.files import Files
from CIME.utils import convert_to_unknown_type, get_cime_config
import socket
logger = logging.getLogger(... | 37.55618 | 140 | 0.608153 | from CIME.XML.standard_module_setup import *
from CIME.XML.generic_xml import GenericXML
from CIME.XML.files import Files
from CIME.utils import convert_to_unknown_type, get_cime_config
import socket
logger = logging.getLogger(__name__)
class Machines(GenericXML):
def __init__(self, infile=None, files=None, mac... | true | true |
f725df17ca09efe9699ffac94afdaac33246a3bd | 2,794 | py | Python | test/functional/rpc_invalidateblock.py | 1185/starwels | 48800688ae90318ac6ed74796dde42ac283484e9 | [
"MIT"
] | null | null | null | test/functional/rpc_invalidateblock.py | 1185/starwels | 48800688ae90318ac6ed74796dde42ac283484e9 | [
"MIT"
] | null | null | null | test/functional/rpc_invalidateblock.py | 1185/starwels | 48800688ae90318ac6ed74796dde42ac283484e9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Starwels developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the invalidateblock RPC."""
from test_framework.test_framework import StarwelsTestFramework
from test... | 42.984615 | 100 | 0.659628 |
from test_framework.test_framework import StarwelsTestFramework
from test_framework.util import *
class InvalidateTest(StarwelsTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 3
def setup_network(self):
self.setup_nodes()
def run_test(... | true | true |
f725dff5cb4fe0332ca1c2febb521e5f7662dff2 | 41,343 | py | Python | xdl/third_party/seastar/configure.py | Ru-Xiang/x-deeplearning | 04cc0497150920c64b06bb8c314ef89977a3427a | [
"Apache-2.0"
] | 4,071 | 2018-12-13T04:17:38.000Z | 2022-03-30T03:29:35.000Z | xdl/third_party/seastar/configure.py | laozhuang727/x-deeplearning | 781545783a4e2bbbda48fc64318fb2c6d8bbb3cc | [
"Apache-2.0"
] | 359 | 2018-12-21T01:14:57.000Z | 2022-02-15T07:18:02.000Z | xdl/third_party/seastar/configure.py | laozhuang727/x-deeplearning | 781545783a4e2bbbda48fc64318fb2c6d8bbb3cc | [
"Apache-2.0"
] | 1,054 | 2018-12-20T09:57:42.000Z | 2022-03-29T07:16:53.000Z | #!/usr/bin/env python3
#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
# distributed with this work for additional information regarding copyright
# ownership. You may not use this file except in compliance with the Licen... | 44.028754 | 411 | 0.596619 |
import os, os.path, textwrap, argparse, sys, shlex, subprocess, tempfile, re
configure_args = str.join(' ', [shlex.quote(x) for x in sys.argv[1:]])
tempfile.tempdir = "./build/tmp"
srcdir = os.getcwd()
def get_flags():
with open('/proc/cpuinfo') as f:
for line in f:
if line... | true | true |
f725e0913b22178375a220d288839fa6706545f3 | 520 | py | Python | backend/utils/management/commands/generate_dummy_skills.py | NumanIbnMazid/numanibnmazid.com | 905e3afab285316d88bafa30dc080dfbb0611731 | [
"MIT"
] | 1 | 2022-01-28T18:20:19.000Z | 2022-01-28T18:20:19.000Z | backend/utils/management/commands/generate_dummy_skills.py | NumanIbnMazid/numanibnmazid.com | 905e3afab285316d88bafa30dc080dfbb0611731 | [
"MIT"
] | null | null | null | backend/utils/management/commands/generate_dummy_skills.py | NumanIbnMazid/numanibnmazid.com | 905e3afab285316d88bafa30dc080dfbb0611731 | [
"MIT"
] | null | null | null | from portfolios.factories.skill_factory import create_skills_with_factory
from django.db import transaction
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Generates dummy data"
def _generate_dummy_data(self):
# Create dummy data
create_skills_with_fact... | 26 | 73 | 0.698077 | from portfolios.factories.skill_factory import create_skills_with_factory
from django.db import transaction
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Generates dummy data"
def _generate_dummy_data(self):
create_skills_with_factory(
nu... | true | true |
f725e110043f228bbfec7d077af9fa005de2f6e4 | 3,844 | py | Python | api/applications/views/documents.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | null | null | null | api/applications/views/documents.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | null | null | null | api/applications/views/documents.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | null | null | null | from django.db import transaction
from django.http import JsonResponse
from rest_framework import status
from rest_framework.views import APIView
from api.applications.libraries.document_helpers import (
upload_application_document,
delete_application_document,
get_application_document,
upload_goods_ty... | 34.630631 | 120 | 0.751821 | from django.db import transaction
from django.http import JsonResponse
from rest_framework import status
from rest_framework.views import APIView
from api.applications.libraries.document_helpers import (
upload_application_document,
delete_application_document,
get_application_document,
upload_goods_ty... | true | true |
f725e3b94ce4f481a86a65896844cc39a93fc830 | 14,044 | py | Python | Blender_CamGen/update.py | Arne-Petersen/Plenoptic-Simulation | 7ca4923eacef16f0282daa511680fb28735eecfa | [
"MIT"
] | 28 | 2018-05-04T13:08:32.000Z | 2022-03-10T10:42:17.000Z | Blender_CamGen/update.py | Arne-Petersen/Plenoptic-Simulation | 7ca4923eacef16f0282daa511680fb28735eecfa | [
"MIT"
] | 14 | 2020-01-14T10:04:38.000Z | 2021-11-10T05:27:29.000Z | Blender_CamGen/update.py | Arne-Petersen/Plenoptic-Simulation | 7ca4923eacef16f0282daa511680fb28735eecfa | [
"MIT"
] | 10 | 2018-09-13T05:50:30.000Z | 2021-05-18T10:19:58.000Z | import bpy
import math
import mathutils
from os import listdir
from os.path import isfile, join
from . raytracer import sensor_position_for_distance
from . import calc
from . import create
from . import data
# ------------------------------------------------------------------------
# Helper functions
# ---------... | 48.09589 | 180 | 0.641698 | import bpy
import math
import mathutils
from os import listdir
from os.path import isfile, join
from . raytracer import sensor_position_for_distance
from . import calc
from . import create
from . import data
def find_items(self, context):
if (not data.objective_list_created):
lensfile... | true | true |
f725e3d6c35a6ace2f3a7fec8105649f2c8fe230 | 928 | py | Python | setup.py | datopian/ckanext-datajson | 808b211ba50e681e3b146c76443c456262836d0f | [
"CC0-1.0"
] | 7 | 2019-11-18T12:00:04.000Z | 2020-04-23T16:50:05.000Z | setup.py | datopian/ckanext-datajson | 808b211ba50e681e3b146c76443c456262836d0f | [
"CC0-1.0"
] | 3 | 2019-12-19T17:24:14.000Z | 2019-12-30T16:37:41.000Z | setup.py | datopian/ckanext-datajson | 808b211ba50e681e3b146c76443c456262836d0f | [
"CC0-1.0"
] | 2 | 2020-01-10T07:00:08.000Z | 2020-01-11T17:17:51.000Z | from setuptools import setup, find_packages
import sys, os
version = '0.5.1'
setup(
name='ckanext-datajson',
version=version,
description="CKAN extension to generate /data.json",
long_description="""\
""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='',
a... | 28.121212 | 90 | 0.755388 | from setuptools import setup, find_packages
import sys, os
version = '0.5.1'
setup(
name='ckanext-datajson',
version=version,
description="CKAN extension to generate /data.json",
long_description="""\
""",
classifiers=[],
keywords='',
author='U.S. Department of Health & Human Services',
author_email='',
ur... | true | true |
f725e4f38e778a0e50ae9528f3771e4a2929df2b | 839 | py | Python | examples/set_sample_name.py | Molmed/genologics | 23d80bf67f6f376d218643f470e4f59c35301503 | [
"MIT"
] | null | null | null | examples/set_sample_name.py | Molmed/genologics | 23d80bf67f6f376d218643f470e4f59c35301503 | [
"MIT"
] | 2 | 2021-03-29T07:45:41.000Z | 2021-04-07T11:07:13.000Z | examples/set_sample_name.py | Molmed/genologics | 23d80bf67f6f376d218643f470e4f59c35301503 | [
"MIT"
] | 1 | 2017-12-01T09:47:48.000Z | 2017-12-01T09:47:48.000Z | """Python interface to GenoLogics LIMS via its REST API.
Example usage: Set the name and a UDF of a sample.
Per Kraulis, Science for Life Laboratory, Stockholm, Sweden.
"""
from genologics.lims import *
# Login parameters for connecting to a LIMS instance.
from genologics.config import BASEURI, USERNAME, PASSWORD... | 26.21875 | 77 | 0.740167 |
from genologics.lims import *
from genologics.config import BASEURI, USERNAME, PASSWORD
lims = Lims(BASEURI, USERNAME, PASSWORD)
lims.check_version()
sample = Sample(lims, id='JGR58A21')
print(sample, sample.name)
sample.name = 'Joels extra-proper sample-20'
sample.udf['Emmas field 2'] = 5
for key, value in l... | true | true |
f725e59d66a1d6603562790280eee92932029c00 | 1,337 | py | Python | data_preprocessing_scripts/preprocess.py | SatyaSiddharthDash/headlinegen | ec11cb4b4dd4e6dce553c787cf31670a83f1c650 | [
"MIT"
] | null | null | null | data_preprocessing_scripts/preprocess.py | SatyaSiddharthDash/headlinegen | ec11cb4b4dd4e6dce553c787cf31670a83f1c650 | [
"MIT"
] | null | null | null | data_preprocessing_scripts/preprocess.py | SatyaSiddharthDash/headlinegen | ec11cb4b4dd4e6dce553c787cf31670a83f1c650 | [
"MIT"
] | null | null | null | import pandas as pd
from sklearn.model_selection import train_test_split
random_state = 100
data = pd.read_csv("~/headlinegen/data/nytime_front_page.csv")
data['title'] = data['title'].apply(lambda x: ' '.join(x.split(' ')[:-5]))
lens = data["content"].apply(lambda x: len(x.split(" "))).nlargest(10)
print(
f'm... | 38.2 | 98 | 0.562453 | import pandas as pd
from sklearn.model_selection import train_test_split
random_state = 100
data = pd.read_csv("~/headlinegen/data/nytime_front_page.csv")
data['title'] = data['title'].apply(lambda x: ' '.join(x.split(' ')[:-5]))
lens = data["content"].apply(lambda x: len(x.split(" "))).nlargest(10)
print(
f'm... | true | true |
f725e5b14deab24e3329989fdf04feb3afb579fb | 6,848 | py | Python | tests/test_pg_connect.py | ktechboston/db_utils | b6e7787be832a79fc21ec63aa0860a50871cc227 | [
"MIT"
] | 1 | 2019-07-20T01:43:02.000Z | 2019-07-20T01:43:02.000Z | tests/test_pg_connect.py | ktechboston/db_utils | b6e7787be832a79fc21ec63aa0860a50871cc227 | [
"MIT"
] | 5 | 2019-07-15T14:21:28.000Z | 2019-07-24T20:09:25.000Z | tests/test_pg_connect.py | ktechboston/db_utils | b6e7787be832a79fc21ec63aa0860a50871cc227 | [
"MIT"
] | 1 | 2019-06-24T02:29:55.000Z | 2019-06-24T02:29:55.000Z | import unittest
import sys
import os
import csv
import psycopg2
from pprint import pprint
sys.path.insert(0, '..')
from db_utils.pg_connect import pg_connect
config_file = 'databases.conf'
db = pg_connect('postgres', config_file)
table = 'test_table'
class test_pg_connect(unittest.TestCase):
def setUp(self):
... | 28.297521 | 120 | 0.580169 | import unittest
import sys
import os
import csv
import psycopg2
from pprint import pprint
sys.path.insert(0, '..')
from db_utils.pg_connect import pg_connect
config_file = 'databases.conf'
db = pg_connect('postgres', config_file)
table = 'test_table'
class test_pg_connect(unittest.TestCase):
def setUp(self):
... | true | true |
f725e6c764dab91197ce2e121ea19b4508af987d | 8,933 | py | Python | stlearn/tools/microenv/cci/base_grouping.py | duypham2108/stLearn | 91b6bae91b29aba8b4f055bf92da13f1558ddbe8 | [
"BSD-3-Clause"
] | null | null | null | stlearn/tools/microenv/cci/base_grouping.py | duypham2108/stLearn | 91b6bae91b29aba8b4f055bf92da13f1558ddbe8 | [
"BSD-3-Clause"
] | null | null | null | stlearn/tools/microenv/cci/base_grouping.py | duypham2108/stLearn | 91b6bae91b29aba8b4f055bf92da13f1558ddbe8 | [
"BSD-3-Clause"
] | 1 | 2019-12-12T12:46:55.000Z | 2019-12-12T12:46:55.000Z | """ Performs LR analysis by grouping LR pairs which having hotspots across
similar tissues.
"""
from stlearn.pl import het_plot
from sklearn.cluster import DBSCAN, AgglomerativeClustering
from anndata import AnnData
from tqdm import tqdm
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import... | 33.085185 | 175 | 0.614799 |
from stlearn.pl import het_plot
from sklearn.cluster import DBSCAN, AgglomerativeClustering
from anndata import AnnData
from tqdm import tqdm
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sb
def get_hotspots(
adata: AnnData,
lr_scores: np.ndarray,
lrs: np.array,... | true | true |
f725e6deed60db8da5ead0d23368ad990e104030 | 5,821 | py | Python | tf_agents/bandits/agents/utils_test.py | MarkDaoust/agents | 00ddf75a8a35a26a03a9323b78d95c06211b5b3f | [
"Apache-2.0"
] | null | null | null | tf_agents/bandits/agents/utils_test.py | MarkDaoust/agents | 00ddf75a8a35a26a03a9323b78d95c06211b5b3f | [
"Apache-2.0"
] | null | null | null | tf_agents/bandits/agents/utils_test.py | MarkDaoust/agents | 00ddf75a8a35a26a03a9323b78d95c06211b5b3f | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 38.045752 | 79 | 0.695585 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tf_agents.bandits.agents import utils
from tf_agents.specs import t... | true | true |
f725e6fdee776868b7306032eb1649135fbb2a82 | 1,471 | py | Python | migrations/versions/5bc9e9b6c3ff_unify_local_and_remote_int8.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 23 | 2022-03-17T12:24:09.000Z | 2022-03-31T09:13:30.000Z | migrations/versions/5bc9e9b6c3ff_unify_local_and_remote_int8.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 18 | 2022-03-21T08:17:44.000Z | 2022-03-30T12:42:30.000Z | migrations/versions/5bc9e9b6c3ff_unify_local_and_remote_int8.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 16 | 2022-03-17T12:24:14.000Z | 2022-03-31T12:15:12.000Z | """Unify local and remote int8
Revision ID: 5bc9e9b6c3ff
Revises: 7f3c818591e1
Create Date: 2021-03-29 15:28:58.945918
"""
"""
OpenVINO DL Workbench
Migration: Unify local and remote int8
Copyright (c) 2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this ... | 28.843137 | 73 | 0.734194 |
from alembic import op
import sqlalchemy as sa
revision = '5bc9e9b6c3ff'
down_revision = '7f3c818591e1'
branch_labels = None
depends_on = None
def upgrade():
sa.PrimaryKeyConstraint('job_id')
)
| true | true |
f725e78ae37c1db3941ba4ddd91efca669d47928 | 1,424 | py | Python | backend/users/models.py | crowdbotics-apps/flightlevel36zero-31803 | 6c81d2e9394440810c1a5561752a452619388c10 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/users/models.py | crowdbotics-apps/flightlevel36zero-31803 | 6c81d2e9394440810c1a5561752a452619388c10 | [
"FTL",
"AML",
"RSA-MD"
] | 38 | 2021-09-11T01:00:31.000Z | 2021-12-05T17:43:03.000Z | backend/users/models.py | crowdbotics-apps/natures-cornucopia-30308 | 847053dad41bda7122bc15710e0e9e2bf89d6882 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.conf import settings
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
class User(AbstractUser):
# WARNING!
"""
Some officially supported features of Crowdbotics Dashboard dep... | 27.921569 | 85 | 0.665028 | from django.conf import settings
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
class User(AbstractUser):
name = models.CharField(
null=True,
blank=True,
max_lengt... | true | true |
f725e948ab21699d629dd278dd83cd81a9a7c910 | 3,205 | py | Python | hddcoin/types/weight_proof.py | JakubSido/hddcoin-blockchain | 7b9da03edee3512295c0f142c07c4759512ccbca | [
"Apache-2.0"
] | 37 | 2021-07-08T23:42:01.000Z | 2022-03-26T21:30:10.000Z | hddcoin/types/weight_proof.py | JakubSido/hddcoin-blockchain | 7b9da03edee3512295c0f142c07c4759512ccbca | [
"Apache-2.0"
] | 13 | 2021-07-11T15:12:01.000Z | 2022-03-15T08:36:18.000Z | hddcoin/types/weight_proof.py | JakubSido/hddcoin-blockchain | 7b9da03edee3512295c0f142c07c4759512ccbca | [
"Apache-2.0"
] | 19 | 2021-07-10T14:09:07.000Z | 2022-03-14T11:17:05.000Z | from dataclasses import dataclass
from typing import List, Optional
from hddcoin.types.blockchain_format.proof_of_space import ProofOfSpace
from hddcoin.types.blockchain_format.reward_chain_block import RewardChainBlock
from hddcoin.types.blockchain_format.sized_bytes import bytes32
from hddcoin.types.blockchain_forma... | 31.116505 | 95 | 0.737285 | from dataclasses import dataclass
from typing import List, Optional
from hddcoin.types.blockchain_format.proof_of_space import ProofOfSpace
from hddcoin.types.blockchain_format.reward_chain_block import RewardChainBlock
from hddcoin.types.blockchain_format.sized_bytes import bytes32
from hddcoin.types.blockchain_forma... | true | true |
f725e98002e1d4f074db4ac84131dc56e48d490e | 395 | py | Python | WalletSystem/walletApp/helpers.py | BakrFrag/Wallet-System | cc4a1114bc0811ef198ae5bc5689cb8696270e91 | [
"MIT"
] | null | null | null | WalletSystem/walletApp/helpers.py | BakrFrag/Wallet-System | cc4a1114bc0811ef198ae5bc5689cb8696270e91 | [
"MIT"
] | null | null | null | WalletSystem/walletApp/helpers.py | BakrFrag/Wallet-System | cc4a1114bc0811ef198ae5bc5689cb8696270e91 | [
"MIT"
] | null | null | null | from .models import Wallet;
from django.core.exceptions import ObjectDoesNotExist
def getWallet(phone_number):
"""
helper function check if wallet with phone number exists or not
"""
try:
walletobj=Wallet.objects.get(phone=phone_number);
return {"exists":True,"wallet":walletobj}
exce... | 35.909091 | 67 | 0.701266 | from .models import Wallet;
from django.core.exceptions import ObjectDoesNotExist
def getWallet(phone_number):
try:
walletobj=Wallet.objects.get(phone=phone_number);
return {"exists":True,"wallet":walletobj}
except Wallet.DoesNotExist as E:
return {"exists":False,"wallet":None}; | true | true |
f725e992c7f42887faa027f5696991c0ea53be19 | 1,092 | py | Python | inv/models/modelmapping.py | xUndero/noc | 9fb34627721149fcf7064860bd63887e38849131 | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | inv/models/modelmapping.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | inv/models/modelmapping.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# ModelMapping model
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# -------------------------------------------------------------... | 33.090909 | 91 | 0.591575 |
from mongoengine.document import Document
from mongoengine.fields import StringField, BooleanField
from noc.inv.models.objectmodel import ObjectModel
from noc.core.mongo.fields import PlainReferenceField
class ModelMapping(Document):
meta = {"collection": "noc.modelmappings", "strict": False, "auto_cre... | true | true |
f725e9ad0a9d9b3dd8993d5832c9cd8a2351f823 | 78,589 | py | Python | sdk/python/pulumi_azure_native/synapse/v20190601preview/_inputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/synapse/v20190601preview/_inputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/synapse/v20190601preview/_inputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 39.099005 | 247 | 0.663935 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from ._enums import *
__all__ = [
'AutoPausePropertiesArgs',
'AutoScalePropertiesArgs',
'CmdkeySetupArgs',
'ComponentSetupArgs',
'CustomerManagedKe... | true | true |
f725e9edf7e34a8ae2a8f7d0c50a703b007c2913 | 26,732 | py | Python | EZclim/user_entry.py | msc-acse/acse-9-independent-research-project-AdannaAkwats | 3a46de2e95b35ef095d2376e7237fad14e058b3e | [
"MIT"
] | null | null | null | EZclim/user_entry.py | msc-acse/acse-9-independent-research-project-AdannaAkwats | 3a46de2e95b35ef095d2376e7237fad14e058b3e | [
"MIT"
] | null | null | null | EZclim/user_entry.py | msc-acse/acse-9-independent-research-project-AdannaAkwats | 3a46de2e95b35ef095d2376e7237fad14e058b3e | [
"MIT"
] | 5 | 2019-06-21T16:14:28.000Z | 2021-01-22T07:53:54.000Z | """
Created by Adanna Akwataghibe (Github: AdannaAkwats)
"""
import argparse
from calendar import monthrange
from Extract import *
from Analysis import *
from WriteOutput import *
from plots import *
from utils import check_valid_order, check_analysis, check_variables_covary, print_end_statement
from calculate_indices ... | 46.734266 | 189 | 0.567111 | import argparse
from calendar import monthrange
from Extract import *
from Analysis import *
from WriteOutput import *
from plots import *
from utils import check_valid_order, check_analysis, check_variables_covary, print_end_statement
from calculate_indices import *
from file_entry import file_entry
from ProgressBar i... | true | true |
f725eaa93df16bb582f142e4fc6adc97b25e4daf | 15,232 | py | Python | neutron/services/segments/db.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | null | null | null | neutron/services/segments/db.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | neutron/services/segments/db.py | knodir/neutron | ac4e28478ac8a8a0c9f5c5785f6a6bcf532c66b8 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright 2016 Hewlett Packard Enterprise Development, LP
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENS... | 42.311111 | 79 | 0.66787 |
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants
from neutron_lib.db import api as db_api
from neutron_lib.db import resource_extend
from neutron_lib.db import utils as db_utils
from neutron_... | true | true |
f725eaff0d679e4b23a48f9e1c42ebd9f7f1365b | 8,673 | py | Python | cairis/test/test_GoalAPI.py | RAIJ95/https-github.com-failys-cairis | 86601347ea016f4a3f90b6942093d63e91de5f74 | [
"Apache-2.0"
] | null | null | null | cairis/test/test_GoalAPI.py | RAIJ95/https-github.com-failys-cairis | 86601347ea016f4a3f90b6942093d63e91de5f74 | [
"Apache-2.0"
] | null | null | null | cairis/test/test_GoalAPI.py | RAIJ95/https-github.com-failys-cairis | 86601347ea016f4a3f90b6942093d63e91de5f74 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 38.71875 | 152 | 0.684769 |
import logging
from urllib import quote
import jsonpickle
from cairis.core.Goal import Goal
from cairis.core.GoalEnvironmentProperties import GoalEnvironmentProperties
from cairis.test.CairisDaemonTestCase import CairisDaemonTestCase
import os
from cairis.mio.ModelImport import importModelFile
__auth... | true | true |
f725eb967997a72b04e8458957fc69f1e97cbee0 | 24,951 | py | Python | osf/models/registrations.py | mattclark/osf.io | 7a362ceb6af3393d3d0423aafef336ee13277303 | [
"Apache-2.0"
] | null | null | null | osf/models/registrations.py | mattclark/osf.io | 7a362ceb6af3393d3d0423aafef336ee13277303 | [
"Apache-2.0"
] | null | null | null | osf/models/registrations.py | mattclark/osf.io | 7a362ceb6af3393d3d0423aafef336ee13277303 | [
"Apache-2.0"
] | null | null | null | import logging
import datetime
import urlparse
from django.core.exceptions import ValidationError
from django.db import models
from django.utils import timezone
from framework.auth import Auth
from framework.exceptions import PermissionsError
from osf.utils.fields import NonNaiveDateTimeField
from osf.exceptions impo... | 37.633484 | 164 | 0.624945 | import logging
import datetime
import urlparse
from django.core.exceptions import ValidationError
from django.db import models
from django.utils import timezone
from framework.auth import Auth
from framework.exceptions import PermissionsError
from osf.utils.fields import NonNaiveDateTimeField
from osf.exceptions impo... | true | true |
f725ebb2af351289e10da0b9ff19a8676765fe30 | 2,020 | py | Python | dask/dataframe/tests/test_hashing.py | abhinavralhan/dask | e840ba38eadfa93c3b9959347f0a43c1279a94ab | [
"BSD-3-Clause"
] | 2 | 2018-12-29T13:47:40.000Z | 2018-12-29T13:47:49.000Z | dask/dataframe/tests/test_hashing.py | abhinavralhan/dask | e840ba38eadfa93c3b9959347f0a43c1279a94ab | [
"BSD-3-Clause"
] | 2 | 2019-03-19T22:19:04.000Z | 2019-03-26T19:04:00.000Z | dask/dataframe/tests/test_hashing.py | abhinavralhan/dask | e840ba38eadfa93c3b9959347f0a43c1279a94ab | [
"BSD-3-Clause"
] | 1 | 2021-03-28T04:50:43.000Z | 2021-03-28T04:50:43.000Z | import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pytest
from dask.dataframe.hashing import hash_pandas_object
from dask.dataframe.utils import assert_eq
@pytest.mark.parametrize('obj', [
pd.Series([1, 2, 3]),
pd.Series([1.0, 1.5, 3.2]),
pd.Series([1.0, 1.5, 3.2], index=[1.5... | 34.827586 | 79 | 0.637129 | import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pytest
from dask.dataframe.hashing import hash_pandas_object
from dask.dataframe.utils import assert_eq
@pytest.mark.parametrize('obj', [
pd.Series([1, 2, 3]),
pd.Series([1.0, 1.5, 3.2]),
pd.Series([1.0, 1.5, 3.2], index=[1.5... | true | true |
f725ebe4a0002cf0ad0cfd933670021232062f21 | 2,166 | py | Python | dataset_processing.py | alechfho/dog_breed | 2e2f7083c859fdb250f5ba920246b9d2f8168b4d | [
"Apache-2.0"
] | null | null | null | dataset_processing.py | alechfho/dog_breed | 2e2f7083c859fdb250f5ba920246b9d2f8168b4d | [
"Apache-2.0"
] | null | null | null | dataset_processing.py | alechfho/dog_breed | 2e2f7083c859fdb250f5ba920246b9d2f8168b4d | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
def partition_images(df_labels, identifier_label=None, label_postfix='postfix', target_dir='./', filter_identity=[],
dev_portion=0.20, encoding_strategy='vgg19_4096'):
if np.size(filter_identity) == 0:
filter_identity = df_labels[identifier_label... | 47.086957 | 120 | 0.72807 | import numpy as np
import pandas as pd
def partition_images(df_labels, identifier_label=None, label_postfix='postfix', target_dir='./', filter_identity=[],
dev_portion=0.20, encoding_strategy='vgg19_4096'):
if np.size(filter_identity) == 0:
filter_identity = df_labels[identifier_label... | true | true |
f725ec3baf077b8402ef54fa4ab3be9010a6ff8a | 6,686 | py | Python | ical_fusion.py | octogene/icalfusion | 3c00762d7d9353ed65109deef001cb7ba94051d1 | [
"MIT"
] | null | null | null | ical_fusion.py | octogene/icalfusion | 3c00762d7d9353ed65109deef001cb7ba94051d1 | [
"MIT"
] | null | null | null | ical_fusion.py | octogene/icalfusion | 3c00762d7d9353ed65109deef001cb7ba94051d1 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 Bogdan Cordier
#
# Distributed under terms of the MIT license.
import datetime
from icalendar import Calendar
from pytz import timezone
from dateutil.parser import parse
from tkinter import Tk, filedialog, Listbox, Button, Entry, Str... | 36.939227 | 78 | 0.551152 |
import datetime
from icalendar import Calendar
from pytz import timezone
from dateutil.parser import parse
from tkinter import Tk, filedialog, Listbox, Button, Entry, StringVar, \
LabelFrame, BooleanVar, Frame, ttk, END, Checkbutton, messagebox
local_timezone = timezone('Europe/Paris')
ical_fields = ('SUMM... | true | true |
f725ecc93cfb05f785f6599c6384eea2e2c02e46 | 7,910 | py | Python | utilbox/string_utils/string_utils.py | jensonjose/utilbox | f47ac1c97fdd3f7caf8ea1c6b693ea115076f0e8 | [
"MIT"
] | 1 | 2017-07-08T17:59:09.000Z | 2017-07-08T17:59:09.000Z | utilbox/string_utils/string_utils.py | jensonjose/utilbox | f47ac1c97fdd3f7caf8ea1c6b693ea115076f0e8 | [
"MIT"
] | 1 | 2017-08-12T13:51:37.000Z | 2017-08-12T13:51:37.000Z | utilbox/string_utils/string_utils.py | jensonjose/utilbox | f47ac1c97fdd3f7caf8ea1c6b693ea115076f0e8 | [
"MIT"
] | 1 | 2018-10-27T06:13:22.000Z | 2018-10-27T06:13:22.000Z | """
Utility module to manipulate strings.
"""
import re
import types
__author__ = "Jenson Jose"
__email__ = "jensonjose@live.in"
__status__ = "Alpha"
class StringUtils:
"""
Utility class containing methods for manipulation of strings.
"""
def __init__(self):
pass
@staticmethod
def ... | 27.465278 | 110 | 0.594817 |
import re
import types
__author__ = "Jenson Jose"
__email__ = "jensonjose@live.in"
__status__ = "Alpha"
class StringUtils:
def __init__(self):
pass
@staticmethod
def is_blank(string):
if string.strip():
return False
return True
@staticmethod
def join_list... | true | true |
f725eecf105d6cb129a87a1af62fe37c37cb459b | 2,613 | py | Python | heppyplot/plot_helpers.py | ebothmann/heppyplot | dab969879391f70a91c34f71482a9691b9c80141 | [
"MIT"
] | null | null | null | heppyplot/plot_helpers.py | ebothmann/heppyplot | dab969879391f70a91c34f71482a9691b9c80141 | [
"MIT"
] | null | null | null | heppyplot/plot_helpers.py | ebothmann/heppyplot | dab969879391f70a91c34f71482a9691b9c80141 | [
"MIT"
] | null | null | null | import math
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.transforms as mtransforms
from mpl_toolkits.axes_grid.anchored_artists import AnchoredText
def setup_axes(diff=False):
fig = plt.figure()
axes = []
if diff:
gs = gridspec.GridSpec(2, 1, height_rati... | 37.328571 | 95 | 0.643705 | import math
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.transforms as mtransforms
from mpl_toolkits.axes_grid.anchored_artists import AnchoredText
def setup_axes(diff=False):
fig = plt.figure()
axes = []
if diff:
gs = gridspec.GridSpec(2, 1, height_rati... | true | true |
f725efcbce1ccf39d91c665102551ed46f4594c4 | 187 | py | Python | Introduction_to_python/Module 2 Code Files/greater_than_exercise.py | leogithubid/data-analysis-using-python | 531e4fb3a05393c94979b5c571cda0f107cb5030 | [
"MIT"
] | null | null | null | Introduction_to_python/Module 2 Code Files/greater_than_exercise.py | leogithubid/data-analysis-using-python | 531e4fb3a05393c94979b5c571cda0f107cb5030 | [
"MIT"
] | null | null | null | Introduction_to_python/Module 2 Code Files/greater_than_exercise.py | leogithubid/data-analysis-using-python | 531e4fb3a05393c94979b5c571cda0f107cb5030 | [
"MIT"
] | null | null | null | def greater_than(x, y):
if x > y:
return True
else:
return False
a = 2
b = 3
result = greater_than(a, b)
print("{} is greater than {}: {}".format(a, b, result))
| 15.583333 | 55 | 0.545455 | def greater_than(x, y):
if x > y:
return True
else:
return False
a = 2
b = 3
result = greater_than(a, b)
print("{} is greater than {}: {}".format(a, b, result))
| true | true |
f725f033c68129465884ebe3416f353fef5cfe99 | 1,048 | py | Python | habitat/food/models/tag.py | matrach/habitatOS | 1ae2a3caf6f279cf6d6d20bcd81f24d50f61d7d3 | [
"MIT"
] | 1 | 2021-02-01T19:04:39.000Z | 2021-02-01T19:04:39.000Z | habitat/food/models/tag.py | matrach/habitatOS | 1ae2a3caf6f279cf6d6d20bcd81f24d50f61d7d3 | [
"MIT"
] | null | null | null | habitat/food/models/tag.py | matrach/habitatOS | 1ae2a3caf6f279cf6d6d20bcd81f24d50f61d7d3 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.db import models
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
class Tag(models.Model):
TYPE_CHOICES = [
('product', _('Product')),
('plan', _('Plan')),
('meal', _('Meal')),
]
name = model... | 29.942857 | 107 | 0.623092 | from django.contrib import admin
from django.db import models
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
class Tag(models.Model):
TYPE_CHOICES = [
('product', _('Product')),
('plan', _('Plan')),
('meal', _('Meal')),
]
name = model... | true | true |
f725f048c2db89cfc4013eb72273fee66ea06245 | 835 | py | Python | examples/beginner/limits_examples.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | examples/beginner/limits_examples.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | examples/beginner/limits_examples.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""Limits Example
Demonstrates limits.
"""
from sympy import exp, log, Symbol, Rational, sin, limit, sqrt, oo
def sqrt3(x):
return x ** Rational(1, 3)
def show(computed, correct):
print("computed:", computed, "correct:", correct)
def main():
x = Symbol("x")
show(limit(sqr... | 20.365854 | 70 | 0.534132 |
from sympy import exp, log, Symbol, Rational, sin, limit, sqrt, oo
def sqrt3(x):
return x ** Rational(1, 3)
def show(computed, correct):
print("computed:", computed, "correct:", correct)
def main():
x = Symbol("x")
show(limit(sqrt(x ** 2 - 5 * x + 6) - x, x, oo), -Rational(5) / 2)
show(li... | true | true |
f725f160fe888789fd6fe5f15c095f239fd5e3ba | 4,182 | py | Python | tests/service_test.py | drmobile/pubsub-broker | e5bfface5be95b667a124ac3e47b6683ee25888c | [
"Apache-2.0"
] | 1 | 2020-11-13T16:04:04.000Z | 2020-11-13T16:04:04.000Z | tests/service_test.py | drmobile/pubsub-broker | e5bfface5be95b667a124ac3e47b6683ee25888c | [
"Apache-2.0"
] | 3 | 2018-07-20T09:38:56.000Z | 2018-12-25T06:18:29.000Z | tests/service_test.py | drmobile/pubsub-broker | e5bfface5be95b667a124ac3e47b6683ee25888c | [
"Apache-2.0"
] | 3 | 2018-04-10T10:37:27.000Z | 2018-12-25T06:05:19.000Z | # coding=utf-8
#
import time
import copy
import pytest
import logging
import unittest
import threading
import concurrent.futures
from multiprocessing import Manager
from soocii_pubsub_lib import pubsub_client, sub_service
# ========== Initial Logger ==========
logging.basicConfig(
level=logging.DEBUG,
format=... | 38.018182 | 146 | 0.662602 |
import time
import copy
import pytest
import logging
import unittest
import threading
import concurrent.futures
from multiprocessing import Manager
from soocii_pubsub_lib import pubsub_client, sub_service
logging.basicConfig(
level=logging.DEBUG,
format='[%(asctime)-15s][%(thread)d][%(levelname)-5s][%(file... | true | true |
f725f1c930f026fc5ad6709114adb3ed8d9d5763 | 23,200 | py | Python | examples/tensorflow/text-classification/run_text_classification.py | SeanNaren/transformers | 8d43c71a1ca3ad322cc45008eb66a5611f1e017e | [
"Apache-2.0"
] | 1 | 2021-04-10T07:59:12.000Z | 2021-04-10T07:59:12.000Z | examples/tensorflow/text-classification/run_text_classification.py | SeanNaren/transformers | 8d43c71a1ca3ad322cc45008eb66a5611f1e017e | [
"Apache-2.0"
] | null | null | null | examples/tensorflow/text-classification/run_text_classification.py | SeanNaren/transformers | 8d43c71a1ca3ad322cc45008eb66a5611f1e017e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | 43.122677 | 121 | 0.671078 |
import logging
import os
import random
import sys
from dataclasses import dataclass, field
from math import ceil
from pathlib import Path
from typing import Optional
import numpy as np
from datasets import load_dataset
from transformers import (
AutoConfig,
AutoTokenizer,
HfArgumentParser... | true | true |
f725f1eac8da74b8562cac6b78cc781c40c19706 | 4,237 | py | Python | szkriptek/tag_postproc.py | vadno/korkor_pilot | 8805f3a6a1145420f112d4c1ce95538c698d41ef | [
"CC-BY-4.0"
] | 2 | 2020-09-30T19:25:10.000Z | 2021-11-03T20:23:31.000Z | szkriptek/tag_postproc.py | vadno/korkor_pilot | 8805f3a6a1145420f112d4c1ce95538c698d41ef | [
"CC-BY-4.0"
] | null | null | null | szkriptek/tag_postproc.py | vadno/korkor_pilot | 8805f3a6a1145420f112d4c1ce95538c698d41ef | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author: Vadász Noémi
# created: 2019/03/28
# feldolgozza a google spreadsheetsben annotált, előtte emtsv-vel elemzett korpuszfájlt
# bemenet
# csv (google spreadsheetsből importált)
# token, összes elemzés, tő, részletes címke, tag, helyes, javított tő, tokenizálás, ja... | 26.987261 | 111 | 0.509559 |
import csv
import sys
def read_file():
empty_line = dict()
empty_line['string'] = ''
lines = list()
newtoken = dict()
reader = csv.reader(sys.stdin)
next(reader)
for line in reader:
if line[0] or line[7] == 'token beszúr':
... | true | true |
f725f2459a905256eb3220d58ce2d66c8bceeae6 | 66,037 | py | Python | zerver/lib/events.py | nipunn1313/zulip | 35f9ed6ebe28c7d66e8a62b2c235f19ad0f44a0b | [
"Apache-2.0"
] | 1 | 2021-06-25T18:10:20.000Z | 2021-06-25T18:10:20.000Z | zerver/lib/events.py | nipunn1313/zulip | 35f9ed6ebe28c7d66e8a62b2c235f19ad0f44a0b | [
"Apache-2.0"
] | 10 | 2021-11-15T17:53:29.000Z | 2022-02-27T13:51:47.000Z | zerver/lib/events.py | nipunn1313/zulip | 35f9ed6ebe28c7d66e8a62b2c235f19ad0f44a0b | [
"Apache-2.0"
] | 1 | 2021-11-30T08:00:26.000Z | 2021-11-30T08:00:26.000Z | # See https://zulip.readthedocs.io/en/latest/subsystems/events-system.html for
# high-level documentation on how this system works.
import copy
import time
from typing import Any, Callable, Collection, Dict, Iterable, Optional, Sequence, Set
from django.conf import settings
from django.utils.translation import gettext... | 45.292867 | 100 | 0.616124 |
import copy
import time
from typing import Any, Callable, Collection, Dict, Iterable, Optional, Sequence, Set
from django.conf import settings
from django.utils.translation import gettext as _
from version import API_FEATURE_LEVEL, ZULIP_MERGE_BASE, ZULIP_VERSION
from zerver.lib.actions import (
default_stream_... | true | true |
f725f33a4ea17ac202a72b0756189315bf8f2eb2 | 191 | py | Python | text2speech.py | sumit169-hub/text-to-speech | 589dd36f95abf216676c0ac12a522f2deb70a4db | [
"BSL-1.0"
] | null | null | null | text2speech.py | sumit169-hub/text-to-speech | 589dd36f95abf216676c0ac12a522f2deb70a4db | [
"BSL-1.0"
] | null | null | null | text2speech.py | sumit169-hub/text-to-speech | 589dd36f95abf216676c0ac12a522f2deb70a4db | [
"BSL-1.0"
] | null | null | null | from gtts import gTTS
from playsound import playsound
audio="speech.mp3"
language='en'
sp=gTTS(text=input('ENTER YOUR TEXT: \n') ,lang=language, slow=False)
sp.save(audio)
playsound(audio)
| 21.222222 | 69 | 0.759162 | from gtts import gTTS
from playsound import playsound
audio="speech.mp3"
language='en'
sp=gTTS(text=input('ENTER YOUR TEXT: \n') ,lang=language, slow=False)
sp.save(audio)
playsound(audio)
| true | true |
f725f37fb53556a224003a62cbca39f0bc36a66e | 47,357 | py | Python | dask/dataframe/io/parquet/fastparquet.py | ParticularMiner/dask | f40ef97ac802efb6d8bef03b03c6357cf871bc0a | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/io/parquet/fastparquet.py | ParticularMiner/dask | f40ef97ac802efb6d8bef03b03c6357cf871bc0a | [
"BSD-3-Clause"
] | null | null | null | dask/dataframe/io/parquet/fastparquet.py | ParticularMiner/dask | f40ef97ac802efb6d8bef03b03c6357cf871bc0a | [
"BSD-3-Clause"
] | null | null | null | import copy
import pickle
import threading
import warnings
from collections import OrderedDict, defaultdict
from contextlib import ExitStack
import numpy as np
import pandas as pd
import tlz as toolz
from packaging.version import parse as parse_version
from dask.core import flatten
try:
import fastparquet
fr... | 36.597372 | 96 | 0.51665 | import copy
import pickle
import threading
import warnings
from collections import OrderedDict, defaultdict
from contextlib import ExitStack
import numpy as np
import pandas as pd
import tlz as toolz
from packaging.version import parse as parse_version
from dask.core import flatten
try:
import fastparquet
fr... | true | true |
f725f3882774f4a3c357d3b4d5807560a3f511c3 | 1,457 | py | Python | Projects/Keylogger/key.py | eshaananand/HACKTOBERFEST_2021 | e868968e104639307ae18c7cac842c4a092674fb | [
"MIT"
] | null | null | null | Projects/Keylogger/key.py | eshaananand/HACKTOBERFEST_2021 | e868968e104639307ae18c7cac842c4a092674fb | [
"MIT"
] | null | null | null | Projects/Keylogger/key.py | eshaananand/HACKTOBERFEST_2021 | e868968e104639307ae18c7cac842c4a092674fb | [
"MIT"
] | 9 | 2020-10-15T08:15:01.000Z | 2020-10-19T15:04:26.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 18 00:20:49 2019
@author: Asus
"""
import pynput.keyboard
import threading
import smtplib
class Keylogger:
def __init__(self,time_interval ,email ,password):
self.log ="keylogger started"
self.interval = time_interval
self.email=email
... | 31 | 83 | 0.597804 |
import pynput.keyboard
import threading
import smtplib
class Keylogger:
def __init__(self,time_interval ,email ,password):
self.log ="keylogger started"
self.interval = time_interval
self.email=email
self.password=password
def append_to_log(self,string):
self.log =self.... | true | true |
f725f3d9875d4e6eb82a0011123cb41d1bfeac57 | 149 | py | Python | stograde/student/reset.py | babatana/stograde | c1c447e99c44c23cef9dd857e669861f3708ae77 | [
"MIT"
] | 7 | 2016-08-05T00:41:11.000Z | 2019-08-22T11:12:10.000Z | stograde/student/reset.py | babatana/stograde | c1c447e99c44c23cef9dd857e669861f3708ae77 | [
"MIT"
] | 145 | 2016-08-04T01:07:11.000Z | 2019-09-09T22:07:13.000Z | stograde/student/reset.py | babatana/stograde | c1c447e99c44c23cef9dd857e669861f3708ae77 | [
"MIT"
] | 3 | 2017-02-06T21:52:46.000Z | 2019-02-18T10:35:01.000Z | from ..common import chdir, run
def reset(student: str):
with chdir(student):
run(['git', 'checkout', 'master', '--quiet', '--force'])
| 21.285714 | 64 | 0.590604 | from ..common import chdir, run
def reset(student: str):
with chdir(student):
run(['git', 'checkout', 'master', '--quiet', '--force'])
| true | true |
f725f4ccae39d255e7f8a1319af3c13ec1833d91 | 71 | py | Python | nca47/version.py | WosunOO/nca_xianshu | bbb548cb67b755a57528796d4c5a66ee68df2678 | [
"Apache-2.0"
] | null | null | null | nca47/version.py | WosunOO/nca_xianshu | bbb548cb67b755a57528796d4c5a66ee68df2678 | [
"Apache-2.0"
] | null | null | null | nca47/version.py | WosunOO/nca_xianshu | bbb548cb67b755a57528796d4c5a66ee68df2678 | [
"Apache-2.0"
] | null | null | null | import pbr.version
version_info = pbr.version.VersionInfo('nca47')
| 17.75 | 48 | 0.760563 | import pbr.version
version_info = pbr.version.VersionInfo('nca47')
| true | true |
f725f4dae2e4c5953b2e2ca2570972ac74936c24 | 22,958 | py | Python | lisa/cli/cli.py | Wang-Cankun/lisa2 | 2407cc3c12f43bf41f0e14b2a8a5fcdfe07ff310 | [
"MIT"
] | 17 | 2020-09-21T20:04:43.000Z | 2022-01-15T11:25:41.000Z | lisa/cli/cli.py | Wang-Cankun/lisa2 | 2407cc3c12f43bf41f0e14b2a8a5fcdfe07ff310 | [
"MIT"
] | 1 | 2021-10-04T22:39:05.000Z | 2021-10-04T22:39:05.000Z | lisa/cli/cli.py | Wang-Cankun/lisa2 | 2407cc3c12f43bf41f0e14b2a8a5fcdfe07ff310 | [
"MIT"
] | 5 | 2021-02-16T13:16:34.000Z | 2022-03-08T16:15:25.000Z | '''
********
Lisa CLI
********
Installing LISA using pip or conda adds the "lisa" command to your path. LISA's functionality is divided into three main subcommands:
* `lisa oneshot`_ : one genelist
* `lisa multi`_ : multiple genelists
* `lisa regions`_ : one genelist and a list of regions
Which are used depending on... | 48.029289 | 301 | 0.728548 |
from lisa import FromRegions, FromGenes, FromCoverage
from lisa.core.utils import Log
from lisa.core.lisa_core import DownloadRequiredError
from lisa.core.data_interface import DatasetNotFoundError, INSTALL_PATH
from lisa._version import __version__
import configparser
import argparse
import os
import sys
import json
... | true | true |
f725f58bf735ca99258ae36b96512040ca305b63 | 608,328 | py | Python | src/rust/iced-x86-py/src/iced_x86/Code.py | woodruffw-forks/iced | cf23473cf26cd7215dee7510093fad140c696cc7 | [
"MIT"
] | 1 | 2021-06-10T15:26:22.000Z | 2021-06-10T15:26:22.000Z | src/rust/iced-x86-py/src/iced_x86/Code.py | paulfariello/iced | 08f663ae9626b05ab08ad36dd5143f94aed365b6 | [
"MIT"
] | null | null | null | src/rust/iced-x86-py/src/iced_x86/Code.py | paulfariello/iced | 08f663ae9626b05ab08ad36dd5143f94aed365b6 | [
"MIT"
] | null | null | null | # SPDX-License-Identifier: MIT
# Copyright (C) 2018-present iced project and contributors
# ⚠️This file was generated by GENERATOR!🦹♂️
# pylint: disable=invalid-name
# pylint: disable=line-too-long
# pylint: disable=too-many-lines
"""
x86 instruction code
"""
INVALID: int = 0
"""
It's an invalid instruction, eg. ... | 13.336432 | 131 | 0.606806 |
INVALID: int = 0
DECLAREBYTE: int = 1
DECLAREWORD: int = 2
DECLAREDWORD: int = 3
DECLAREQWORD: int = 4
ADD_RM8_R8: int = 5
ADD_RM16_R16: int = 6
ADD_RM32_R32: int = 7
ADD_RM64_R64: int = 8
ADD_R8_RM8: int = 9
ADD_R16_RM16: int = 10
ADD_R32_RM32: int = 11
ADD_R64_RM64: int = 12
ADD_AL_IMM8: int = 13
ADD_AX_IMM... | true | true |
f725f62d736217414f7205feb40dc8ce94818614 | 4,955 | py | Python | huaweicloud-sdk-bssintl/huaweicloudsdkbssintl/v2/model/show_customer_order_details_response.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-bssintl/huaweicloudsdkbssintl/v2/model/show_customer_order_details_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-bssintl/huaweicloudsdkbssintl/v2/model/show_customer_order_details_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ShowCustomerOrderDetailsResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribu... | 30.398773 | 99 | 0.618769 |
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ShowCustomerOrderDetailsResponse(SdkResponse):
sensitive_list = []
openapi_types = {
'total_count': 'int',
'order_info': 'CustomerOrderV2',
'order_line_items': 'list[OrderLineItemE... | true | true |
f725f695763bfd4fc762cb3bc2d1ac57a86e383c | 811 | py | Python | xlsxwriter/test/chartsheet/test_initialisation.py | haiyangd/XlsxWriter | 81f8c9435b3e03a1458bf9ba314b5d3f7508290f | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2018-02-26T12:31:41.000Z | 2020-10-10T14:14:11.000Z | xlsxwriter/test/chartsheet/test_initialisation.py | haiyangd/XlsxWriter | 81f8c9435b3e03a1458bf9ba314b5d3f7508290f | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/chartsheet/test_initialisation.py | haiyangd/XlsxWriter | 81f8c9435b3e03a1458bf9ba314b5d3f7508290f | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2017, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...chartsheet import Chartsheet
class TestInitialisation(unittest.TestCase):
"""
... | 24.575758 | 79 | 0.591862 | true | true | |
f725f82a65e7831844437922f04c35e5f5cd1ffc | 1,577 | py | Python | python/hetu/gpu_ops/AddConst.py | HugoZHL/Hetu | 51b0aa3d3deeb9c7a5c8e57aecec7b641db750af | [
"Apache-2.0"
] | null | null | null | python/hetu/gpu_ops/AddConst.py | HugoZHL/Hetu | 51b0aa3d3deeb9c7a5c8e57aecec7b641db750af | [
"Apache-2.0"
] | null | null | null | python/hetu/gpu_ops/AddConst.py | HugoZHL/Hetu | 51b0aa3d3deeb9c7a5c8e57aecec7b641db750af | [
"Apache-2.0"
] | 1 | 2021-08-01T09:05:20.000Z | 2021-08-01T09:05:20.000Z | from __future__ import absolute_import
from .Node import Op
from .._base import DNNL_LIB
from ..cpu_links import matrix_elementwise_add_by_const as cpu_matrix_elementwise_add_by_const
from ..gpu_links import matrix_elementwise_add_by_const
class AddByConstOp(Op):
def __init__(self, node_A, const_val, ctx=None):
... | 30.326923 | 94 | 0.660748 | from __future__ import absolute_import
from .Node import Op
from .._base import DNNL_LIB
from ..cpu_links import matrix_elementwise_add_by_const as cpu_matrix_elementwise_add_by_const
from ..gpu_links import matrix_elementwise_add_by_const
class AddByConstOp(Op):
def __init__(self, node_A, const_val, ctx=None):
... | true | true |
f725fa58d83ac3bdbfb6b9632641decaf448c44e | 29,514 | py | Python | mmf/modules/encoders.py | facebookresearch/pythia | 079740bee4b357a7b1b866d35e2f1fad6edba8a4 | [
"BSD-3-Clause"
] | 3,252 | 2018-07-27T02:32:24.000Z | 2020-05-07T17:54:46.000Z | mmf/modules/encoders.py | facebookresearch/pythia | 079740bee4b357a7b1b866d35e2f1fad6edba8a4 | [
"BSD-3-Clause"
] | 209 | 2018-07-30T06:39:59.000Z | 2020-05-04T22:03:48.000Z | mmf/modules/encoders.py | facebookresearch/pythia | 079740bee4b357a7b1b866d35e2f1fad6edba8a4 | [
"BSD-3-Clause"
] | 431 | 2018-07-27T04:17:37.000Z | 2020-05-05T13:58:02.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
import importlib
import logging
import os
import pickle
import re
from collections import OrderedDict
from copy import deepcopy
from dataclasses import asdict, dataclass
from enum import Enum
from typing import Any
import torch
import torchvision
from mmf.common.regis... | 34.763251 | 88 | 0.630345 |
import importlib
import logging
import os
import pickle
import re
from collections import OrderedDict
from copy import deepcopy
from dataclasses import asdict, dataclass
from enum import Enum
from typing import Any
import torch
import torchvision
from mmf.common.registry import registry
from mmf.models.frcnn import G... | true | true |
f725fbcb3a31eaf8eff4449388e052cf673f2915 | 15,435 | py | Python | argopy/fetchers.py | dhruvbalwada/argopy | 66a0b38ab5024d2ff2b7055e0e9b1c62837023a1 | [
"Apache-2.0"
] | null | null | null | argopy/fetchers.py | dhruvbalwada/argopy | 66a0b38ab5024d2ff2b7055e0e9b1c62837023a1 | [
"Apache-2.0"
] | null | null | null | argopy/fetchers.py | dhruvbalwada/argopy | 66a0b38ab5024d2ff2b7055e0e9b1c62837023a1 | [
"Apache-2.0"
] | null | null | null | #!/bin/env python
# -*coding: UTF-8 -*-
"""
High level helper methods to load Argo data from any source
The facade should be able to work with all available data access point,
"""
import warnings
from argopy.options import OPTIONS, _VALIDATORS
from .errors import InvalidFetcherAccessPoint, InvalidFetcher
from .util... | 39.075949 | 121 | 0.593456 |
import warnings
from argopy.options import OPTIONS, _VALIDATORS
from .errors import InvalidFetcherAccessPoint, InvalidFetcher
from .utilities import list_available_data_src, list_available_index_src
from .plotters import plot_trajectory, plot_dac, plot_profilerType
AVAILABLE_DATA_SOURCES = list_available_data_src()... | true | true |
f725fc00d7ebb2835c0b2bf25f77e74b2071941c | 1,732 | py | Python | renameFiles.py | fkorsa/PythonScripts | 3ceb990a4e25eb2ac33c9841f5345de77a456904 | [
"BSD-3-Clause"
] | null | null | null | renameFiles.py | fkorsa/PythonScripts | 3ceb990a4e25eb2ac33c9841f5345de77a456904 | [
"BSD-3-Clause"
] | null | null | null | renameFiles.py | fkorsa/PythonScripts | 3ceb990a4e25eb2ac33c9841f5345de77a456904 | [
"BSD-3-Clause"
] | null | null | null | # Import all dependencies
import re, os, sys
from shutil import copyfile
def GetNewName(oldName, parameters):
"""if (not '.dll' in oldName
and not '.so' in oldName
and not '.eon' in oldName
):
raise ValueError()"""
pattern = r'([a-zA_Z_\.]+)([0-9]+)(.*)'
beginning = re.sub(p... | 36.851064 | 83 | 0.612587 |
import re, os, sys
from shutil import copyfile
def GetNewName(oldName, parameters):
pattern = r'([a-zA_Z_\.]+)([0-9]+)(.*)'
beginning = re.sub(pattern, r'\1', oldName)
pictureIndex = int(re.sub(pattern, r'\2', oldName)) - 1
ending = re.sub(pattern, r'\3', oldName)
pictureIndexString = str(pictureI... | true | true |
f725fd65cd9fd0c6626d2ccb18a6ab12c3269b2d | 734 | py | Python | test/integration/006_source_schema_test/test_source_schemas.py | bastienboutonnet/dbt-helper | 7bf56384ae584542eb22adf5431df1854e95ae9b | [
"Apache-2.0"
] | null | null | null | test/integration/006_source_schema_test/test_source_schemas.py | bastienboutonnet/dbt-helper | 7bf56384ae584542eb22adf5431df1854e95ae9b | [
"Apache-2.0"
] | null | null | null | test/integration/006_source_schema_test/test_source_schemas.py | bastienboutonnet/dbt-helper | 7bf56384ae584542eb22adf5431df1854e95ae9b | [
"Apache-2.0"
] | null | null | null | from test.integration.base import DBTIntegrationTest
class SourceSchemaTest(DBTIntegrationTest):
def test_dependencies(self):
self.run_dbt(["run"])
results = self.run_dbthelper(["show_upstream", "d"])
self.assertTrue(len(results) == 5)
results = self.run_dbthelper(["show_downstream... | 36.7 | 62 | 0.638965 | from test.integration.base import DBTIntegrationTest
class SourceSchemaTest(DBTIntegrationTest):
def test_dependencies(self):
self.run_dbt(["run"])
results = self.run_dbthelper(["show_upstream", "d"])
self.assertTrue(len(results) == 5)
results = self.run_dbthelper(["show_downstream... | true | true |
f725fe7163265998e318929048c9c017ed7a3eaa | 203 | py | Python | scitbx/suffixtree/single.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | scitbx/suffixtree/single.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | scitbx/suffixtree/single.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
import boost_adaptbx.boost.python as bp
ext = bp.import_ext( "scitbx_suffixtree_single_ext" )
from scitbx_suffixtree_single_ext import *
| 33.833333 | 64 | 0.847291 | from __future__ import absolute_import, division, print_function
import boost_adaptbx.boost.python as bp
ext = bp.import_ext( "scitbx_suffixtree_single_ext" )
from scitbx_suffixtree_single_ext import *
| true | true |
f726009e115fa53dcbb215945e9db16a7b200188 | 1,222 | py | Python | DynamicProgramming/matrixChainMultiplication.py | ZPAVelocity/DataStructureExercise | 39b1cce859e5c46599b3a6e69ac80ade5920aa34 | [
"MIT"
] | null | null | null | DynamicProgramming/matrixChainMultiplication.py | ZPAVelocity/DataStructureExercise | 39b1cce859e5c46599b3a6e69ac80ade5920aa34 | [
"MIT"
] | null | null | null | DynamicProgramming/matrixChainMultiplication.py | ZPAVelocity/DataStructureExercise | 39b1cce859e5c46599b3a6e69ac80ade5920aa34 | [
"MIT"
] | null | null | null | import sys
import numpy as np
def main():
p = [30, 35, 15, 5, 10, 20, 25]
m, s = matrixChainOrder(p)
print('m')
for i in m:
print(i)
print('s')
for i in s:
print(i)
def matrixMultiply(A, B):
if A.shape[1] != B.shape[0]:
print('incompatible dimensions')
... | 23.5 | 77 | 0.432079 | import sys
import numpy as np
def main():
p = [30, 35, 15, 5, 10, 20, 25]
m, s = matrixChainOrder(p)
print('m')
for i in m:
print(i)
print('s')
for i in s:
print(i)
def matrixMultiply(A, B):
if A.shape[1] != B.shape[0]:
print('incompatible dimensions')
... | true | true |
f72600ddc98d2dae8f2a00689368dc6c971a3fb8 | 3,248 | py | Python | nib/plugins/blog.py | jreese/nib | 53308e73aae7d10cdc273ab339bb041b07930a75 | [
"MIT"
] | 10 | 2015-02-03T08:21:16.000Z | 2021-12-24T10:08:57.000Z | nib/plugins/blog.py | jreese/nib | 53308e73aae7d10cdc273ab339bb041b07930a75 | [
"MIT"
] | 4 | 2016-09-22T01:18:30.000Z | 2016-09-23T00:18:38.000Z | nib/plugins/blog.py | jreese/nib | 53308e73aae7d10cdc273ab339bb041b07930a75 | [
"MIT"
] | 2 | 2016-09-22T00:39:31.000Z | 2017-03-16T00:09:47.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
import datetime
import re
from nib import Document, Processor, before, document
dateregex = re.compile(r'(?P<year>\d\d\d\d)[-./](?P<month>\d\d)[-./](?P<day>\d\d)')
@before
class BlogDateProcessor(Processor):
def document(self, doc... | 36.494382 | 85 | 0.494458 | from __future__ import absolute_import, division, print_function, unicode_literals
import datetime
import re
from nib import Document, Processor, before, document
dateregex = re.compile(r'(?P<year>\d\d\d\d)[-./](?P<month>\d\d)[-./](?P<day>\d\d)')
@before
class BlogDateProcessor(Processor):
def document(self, doc... | true | true |
f72601e5fda214f23f81969e4034744eaff7b404 | 188 | py | Python | atcoder/abc178C_ubiquity.py | uninhm/kyopro | bf6ed9cbf6a5e46cde0291f7aa9d91a8ddf1f5a3 | [
"BSD-3-Clause"
] | 31 | 2020-05-13T01:07:55.000Z | 2021-07-13T07:53:26.000Z | atcoder/abc178C_ubiquity.py | uninhm/kyopro | bf6ed9cbf6a5e46cde0291f7aa9d91a8ddf1f5a3 | [
"BSD-3-Clause"
] | 10 | 2020-05-20T07:22:09.000Z | 2021-07-19T03:52:13.000Z | atcoder/abc178C_ubiquity.py | uninhm/kyopro | bf6ed9cbf6a5e46cde0291f7aa9d91a8ddf1f5a3 | [
"BSD-3-Clause"
] | 14 | 2020-05-11T05:58:36.000Z | 2021-12-07T03:20:43.000Z | # Vicfred & uninhm
# https://atcoder.jp/contests/abc178/tasks/abc178_c
# combinatorics
n = int(input())
mod = 10**9+7
print((pow(10, n, mod) - 2*pow(9, n, mod) + pow(8, n, mod)) % mod)
| 18.8 | 66 | 0.62234 |
n = int(input())
mod = 10**9+7
print((pow(10, n, mod) - 2*pow(9, n, mod) + pow(8, n, mod)) % mod)
| true | true |
f726020d71b71fa88e43f762ead78c688e3c3a3a | 3,322 | py | Python | language/bert_extraction/steal_bert_qa/data_generation/preprocess_thief_dev_squad.py | IngrojShrestha/language | 674a3d016b1e17658e301e8d9bdfa63e3d3f5d15 | [
"Apache-2.0"
] | 1 | 2020-05-30T15:19:39.000Z | 2020-05-30T15:19:39.000Z | language/bert_extraction/steal_bert_qa/data_generation/preprocess_thief_dev_squad.py | IngrojShrestha/language | 674a3d016b1e17658e301e8d9bdfa63e3d3f5d15 | [
"Apache-2.0"
] | null | null | null | language/bert_extraction/steal_bert_qa/data_generation/preprocess_thief_dev_squad.py | IngrojShrestha/language | 674a3d016b1e17658e301e8d9bdfa63e3d3f5d15 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 31.638095 | 135 | 0.695665 |
import json
import random
import numpy as np
import tensorflow.compat.v1 as tf
app = tf.compat.v1.app
flags = tf.flags
gfile = tf.gfile
logging = tf.logging
flags.DEFINE_string("pool_dataset", None,
"Large pool of queries having training set distribution.")
flags.DEFINE_string("tra... | true | true |
f72604d331367abace2bd7856e05fc96d5ec665a | 3,831 | py | Python | visualisation_engine/settings/dev.py | QualiChain/visualisation_engine_ | 8ec00aa08d703a9f23462d73236f1e20e9168237 | [
"MIT"
] | null | null | null | visualisation_engine/settings/dev.py | QualiChain/visualisation_engine_ | 8ec00aa08d703a9f23462d73236f1e20e9168237 | [
"MIT"
] | null | null | null | visualisation_engine/settings/dev.py | QualiChain/visualisation_engine_ | 8ec00aa08d703a9f23462d73236f1e20e9168237 | [
"MIT"
] | null | null | null | """
Django settings for visualisation_engine project.
Generated by 'django-admin startproject' using Django 3.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
f... | 25.039216 | 91 | 0.692247 |
from pathlib import Path
import os
BASE_DIR = Path(__file__).resolve(strict=True).parent.parent
SECRET_KEY = 's5oyds$!u$m%m#oq6iqr!=sq)$5gt(bo6bnu+2qsg#fcgzfw@b'
DEBUG = True
ALLOWED_HOSTS = ['*']
#CORS
CORS_ORIGIN_ALLOW_ALL = True
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
... | true | true |
f72605046ec8fd6a2d4e80f3aaede195b2b0f3f8 | 233 | py | Python | print_histogram.py | lwoznicki/Python-simple-code | 72486f8f18f8ffc019838be4b1d7d45c68356a0e | [
"MIT"
] | null | null | null | print_histogram.py | lwoznicki/Python-simple-code | 72486f8f18f8ffc019838be4b1d7d45c68356a0e | [
"MIT"
] | null | null | null | print_histogram.py | lwoznicki/Python-simple-code | 72486f8f18f8ffc019838be4b1d7d45c68356a0e | [
"MIT"
] | 1 | 2020-01-04T20:45:26.000Z | 2020-01-04T20:45:26.000Z | def print_histogram(h):
dict = []
dict += sorted(h.keys())
for e in dict:
print(e, h[e])
spaghetti = {'s' : 1, 'p' : 1, 'a' : 1, 'g' : 1, 'h' : 1, 'e' : 1 ,'t' : 2 , 'i' : 1}
print_histogram(spaghetti)
| 25.888889 | 86 | 0.450644 | def print_histogram(h):
dict = []
dict += sorted(h.keys())
for e in dict:
print(e, h[e])
spaghetti = {'s' : 1, 'p' : 1, 'a' : 1, 'g' : 1, 'h' : 1, 'e' : 1 ,'t' : 2 , 'i' : 1}
print_histogram(spaghetti)
| true | true |
f726052b6ebb1901f2bd60dbf982fdea48f38b54 | 12,031 | py | Python | functional_tests/test_views.py | wivn/feed-reader | 1b4524fcdfc79391a5cf982ce9c5681e600f4303 | [
"MIT"
] | null | null | null | functional_tests/test_views.py | wivn/feed-reader | 1b4524fcdfc79391a5cf982ce9c5681e600f4303 | [
"MIT"
] | null | null | null | functional_tests/test_views.py | wivn/feed-reader | 1b4524fcdfc79391a5cf982ce9c5681e600f4303 | [
"MIT"
] | null | null | null | from django.test import LiveServerTestCase
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import e... | 66.104396 | 1,239 | 0.730114 | from django.test import LiveServerTestCase
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import e... | true | true |
f726084efad0da3d822f2612ca1c35a8e0a06715 | 2,932 | py | Python | tests/plugins/test_clang_filters.py | dsoto/dexy | 0f2090250040c3c54c8481a16de8e476b559e87c | [
"MIT"
] | null | null | null | tests/plugins/test_clang_filters.py | dsoto/dexy | 0f2090250040c3c54c8481a16de8e476b559e87c | [
"MIT"
] | null | null | null | tests/plugins/test_clang_filters.py | dsoto/dexy | 0f2090250040c3c54c8481a16de8e476b559e87c | [
"MIT"
] | null | null | null | from tests.utils import assert_output
from tests.utils import wrap
from dexy.doc import Doc
FORTRAN_HELLO_WORLD = """program hello
print *, "Hello World!"
end program hello
"""
CPP_HELLO_WORLD = """#include <iostream>
using namespace std;
int main()
{
cout << "Hello, world!";
return 0;
}
"""
C_HELLO_WORLD = ... | 24.433333 | 76 | 0.537517 | from tests.utils import assert_output
from tests.utils import wrap
from dexy.doc import Doc
FORTRAN_HELLO_WORLD = """program hello
print *, "Hello World!"
end program hello
"""
CPP_HELLO_WORLD = """#include <iostream>
using namespace std;
int main()
{
cout << "Hello, world!";
return 0;
}
"""
C_HELLO_WORLD = ... | true | true |
f72608bcf3958c08d167921ea51ff86f7896570c | 10,372 | py | Python | pygame_geometry/body.py | MarcPartensky/Pygame-Geometry | 61abbbeac0fd351253e06b19736d9939fd5b316e | [
"MIT"
] | 3 | 2021-01-03T18:13:02.000Z | 2021-06-27T21:29:11.000Z | pygame_geometry/body.py | MarcPartensky/Pygame-Geometry | 61abbbeac0fd351253e06b19736d9939fd5b316e | [
"MIT"
] | null | null | null | pygame_geometry/body.py | MarcPartensky/Pygame-Geometry | 61abbbeac0fd351253e06b19736d9939fd5b316e | [
"MIT"
] | null | null | null | from .abstract import Vector, Point, Segment, Circle
from .anatomies import FormAnatomy
from .motion import Motion, Moment
from .material import Material
from .physics import Physics
from . import colors
from pygame.locals import *
from copy import deepcopy
import pygame
import logging
import copy
import random
import... | 31.621951 | 115 | 0.614153 | from .abstract import Vector, Point, Segment, Circle
from .anatomies import FormAnatomy
from .motion import Motion, Moment
from .material import Material
from .physics import Physics
from . import colors
from pygame.locals import *
from copy import deepcopy
import pygame
import logging
import copy
import random
import... | true | true |
f7260982ff15ee479d978bf2768b0d3f1e8c015c | 22,456 | py | Python | python/paddle/fluid/tests/unittests/test_egr_python_api.py | tangzhiyi11/Paddle | 790cadd1f06fabeadc4b9aeca5622ea50985b990 | [
"Apache-2.0"
] | 1 | 2021-12-31T09:01:02.000Z | 2021-12-31T09:01:02.000Z | python/paddle/fluid/tests/unittests/test_egr_python_api.py | tangzhiyi11/Paddle | 790cadd1f06fabeadc4b9aeca5622ea50985b990 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_egr_python_api.py | tangzhiyi11/Paddle | 790cadd1f06fabeadc4b9aeca5622ea50985b990 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 46.686071 | 95 | 0.642679 |
import paddle.fluid.core as core
import paddle.fluid.eager.eager_tensor_patch_methods as eager_tensor_patch_methods
import paddle
import numpy as np
from paddle.fluid.framework import _test_eager_guard, EagerParamBase, _in_eager_mode
from paddle.fluid.data_feeder import convert_dtype
import unittest
impor... | true | true |
f7260a0d88edffe8d516cb9fd3952c72cf448a40 | 1,339 | py | Python | misc/python/materialize/cli/scratch/mine.py | moyun/materialize | 58a59986abfa391375f5178d6fe742c5328155ac | [
"MIT"
] | 1 | 2021-04-02T20:41:35.000Z | 2021-04-02T20:41:35.000Z | misc/python/materialize/cli/scratch/mine.py | moyun/materialize | 58a59986abfa391375f5178d6fe742c5328155ac | [
"MIT"
] | 289 | 2021-02-12T22:25:15.000Z | 2022-03-27T22:12:28.000Z | misc/python/materialize/cli/scratch/mine.py | moyun/materialize | 58a59986abfa391375f5178d6fe742c5328155ac | [
"MIT"
] | 1 | 2021-07-09T11:51:59.000Z | 2021-07-09T11:51:59.000Z | # Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... | 33.475 | 87 | 0.720687 |
import argparse
from typing import Callable
import boto3
from mypy_boto3_ec2.service_resource import Instance
from materialize.cli.scratch import check_required_vars
from materialize.scratch import launched_by, print_instances, tags, whoami
def configure_parser(parser: argparse.ArgumentParser) -> None:
... | true | true |
f7260a5cf2eade315c5bf110204cd445c7e662a3 | 7,966 | py | Python | tests/components/plant/test_init.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 6 | 2020-07-18T16:33:25.000Z | 2021-09-26T09:52:04.000Z | tests/components/plant/test_init.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 38 | 2020-07-23T07:14:17.000Z | 2022-03-31T06:01:46.000Z | tests/components/plant/test_init.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 5 | 2020-03-29T00:29:13.000Z | 2021-09-06T20:58:40.000Z | """Unit tests for platform/plant.py."""
from datetime import datetime, timedelta
import pytest
from homeassistant.components import recorder
import homeassistant.components.plant as plant
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
CONDUCTIVITY,
STATE_OK,
STATE_PROBLEM,
STATE_UNAVA... | 33.330544 | 88 | 0.700603 | from datetime import datetime, timedelta
import pytest
from homeassistant.components import recorder
import homeassistant.components.plant as plant
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
CONDUCTIVITY,
STATE_OK,
STATE_PROBLEM,
STATE_UNAVAILABLE,
STATE_UNKNOWN,
)
from homeas... | true | true |
f7260c42d605bb593528b63732665c5cf39180b2 | 59 | py | Python | core/python/spirit/parameters/__init__.py | SpiritSuperUser/spirit | fbe69c2a9b7a73e8f47d302c619303aea2a22ace | [
"MIT"
] | 2 | 2020-11-12T13:54:22.000Z | 2021-11-05T09:10:27.000Z | core/python/spirit/parameters/__init__.py | SpiritSuperUser/spirit | fbe69c2a9b7a73e8f47d302c619303aea2a22ace | [
"MIT"
] | null | null | null | core/python/spirit/parameters/__init__.py | SpiritSuperUser/spirit | fbe69c2a9b7a73e8f47d302c619303aea2a22ace | [
"MIT"
] | null | null | null | __all__ = ["gneb", "llg"]
from spirit.parameters import *
| 14.75 | 31 | 0.677966 | __all__ = ["gneb", "llg"]
from spirit.parameters import *
| true | true |
f7260dbc831f7d79b0b85a4ce2ff386597e672d5 | 226 | py | Python | src/robust_deid/sequence_tagging/dataset_builder/__init__.py | obi-ml-public/ehr_deidentification | c9deaf30b8317689d28a4267d15ec13baa9791cd | [
"MIT"
] | null | null | null | src/robust_deid/sequence_tagging/dataset_builder/__init__.py | obi-ml-public/ehr_deidentification | c9deaf30b8317689d28a4267d15ec13baa9791cd | [
"MIT"
] | null | null | null | src/robust_deid/sequence_tagging/dataset_builder/__init__.py | obi-ml-public/ehr_deidentification | c9deaf30b8317689d28a4267d15ec13baa9791cd | [
"MIT"
] | null | null | null | from .ner_labels import NERLabels
from .ner_dataset import NERDataset
from .label_mapper import LabelMapper
from .dataset_tokenizer import DatasetTokenizer
__all__=["NERLabels", "NERDataset", "LabelMapper", "DatasetTokenizer"] | 45.2 | 70 | 0.836283 | from .ner_labels import NERLabels
from .ner_dataset import NERDataset
from .label_mapper import LabelMapper
from .dataset_tokenizer import DatasetTokenizer
__all__=["NERLabels", "NERDataset", "LabelMapper", "DatasetTokenizer"] | true | true |
f7260dee0491f9cc625cee893dce44cee0a86ee8 | 1,461 | py | Python | src/pretix/plugins/stripe/tasks.py | NicsTr/pretix | e6d2380d9ed1836cc64a688b2be20d00a8500eab | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-04-25T00:11:00.000Z | 2020-04-25T00:11:00.000Z | src/pretix/plugins/stripe/tasks.py | NicsTr/pretix | e6d2380d9ed1836cc64a688b2be20d00a8500eab | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/plugins/stripe/tasks.py | NicsTr/pretix | e6d2380d9ed1836cc64a688b2be20d00a8500eab | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import logging
from urllib.parse import urlsplit
import stripe
from django.conf import settings
from pretix.base.services.tasks import EventTask
from pretix.celery_app import app
from pretix.multidomain.urlreverse import get_event_domain
from pretix.plugins.stripe.models import RegisteredApplePayDomain
logger = logg... | 28.096154 | 88 | 0.718686 | import logging
from urllib.parse import urlsplit
import stripe
from django.conf import settings
from pretix.base.services.tasks import EventTask
from pretix.celery_app import app
from pretix.multidomain.urlreverse import get_event_domain
from pretix.plugins.stripe.models import RegisteredApplePayDomain
logger = logg... | true | true |
f7260ece4a1e3fc3b43d89b2b456333299b82c9d | 2,817 | py | Python | Q/questionnaire/serializers/serializers_ontologies.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | null | null | null | Q/questionnaire/serializers/serializers_ontologies.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | 477 | 2015-01-07T18:22:27.000Z | 2017-07-17T15:05:48.000Z | Q/questionnaire/serializers/serializers_ontologies.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | null | null | null | ####################
# ES-DOC CIM Questionnaire
# Copyright (c) 2017 ES-DOC. All rights reserved.
#
# University of Colorado, Boulder
# http://cires.colorado.edu/
#
# This project is distributed according to the terms of the MIT license [http://www.opensource.org/licenses/MIT].
####################
from djan... | 34.777778 | 115 | 0.611999 | .models_ontologies import QOntology
from Q.questionnaire.q_utils import serialize_model_to_dict
from Q.questionnaire.q_constants import *
class QOntologySerializer(QSerializer):
class Meta:
model = QOntology
fields = (
'id',
'name',
'version',
'docu... | true | true |
f726102b761a9e6adbb75d3300ca03971c3cffb7 | 533 | py | Python | app/util.py | mkhumtai/6CCS3PRJ | c7d5bedf9529f6e2b7a57e102761716c11f961c8 | [
"MIT"
] | null | null | null | app/util.py | mkhumtai/6CCS3PRJ | c7d5bedf9529f6e2b7a57e102761716c11f961c8 | [
"MIT"
] | null | null | null | app/util.py | mkhumtai/6CCS3PRJ | c7d5bedf9529f6e2b7a57e102761716c11f961c8 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
Flask Boilerplate
Author: AppSeed.us - App Generator
"""
from flask import json
from app import app, db
from .common import *
# build a Json response
def response(data):
return app.response_class(response=json.dumps(data),
status=200,
... | 16.65625 | 58 | 0.594747 |
from flask import json
from app import app, db
from .common import *
def response(data):
return app.response_class(response=json.dumps(data),
status=200,
mimetype='application/json')
def g_db_commit():
db.session.commit()
def g_db_add(obj):
... | true | true |
f726102cba78d004ea78e8999b8ab8ecc337e74b | 968 | py | Python | arm_prosthesis/models/gesture.py | paulrozhkin/arm_prosthesis_raspberry | a643dc84109f1d516fa2ca50414f95f408d6da7d | [
"MIT"
] | 2 | 2021-11-08T01:52:36.000Z | 2021-11-08T01:52:38.000Z | arm_prosthesis/models/gesture.py | paulrozhkin/arm_prosthesis_raspberry | a643dc84109f1d516fa2ca50414f95f408d6da7d | [
"MIT"
] | null | null | null | arm_prosthesis/models/gesture.py | paulrozhkin/arm_prosthesis_raspberry | a643dc84109f1d516fa2ca50414f95f408d6da7d | [
"MIT"
] | 1 | 2020-11-08T16:45:23.000Z | 2020-11-08T16:45:23.000Z | from typing import List
from arm_prosthesis.models.gesture_action import GestureAction
class Gesture:
def __init__(self, uuid: str, name: str, last_time_sync: int, iterable: bool, repetitions: int,
actions: List[GestureAction]):
self._uuid = uuid
self._name = name
... | 24.820513 | 100 | 0.615702 | from typing import List
from arm_prosthesis.models.gesture_action import GestureAction
class Gesture:
def __init__(self, uuid: str, name: str, last_time_sync: int, iterable: bool, repetitions: int,
actions: List[GestureAction]):
self._uuid = uuid
self._name = name
... | true | true |
f726106467d8fad1a2a9e799965ebffea0070438 | 2,395 | py | Python | image-manipulation-processing/thresholding.py | mozbatman/Basic-Opencv-Example | e00aab203064e3e0f225c6aa062997aabe05ccdb | [
"MIT"
] | null | null | null | image-manipulation-processing/thresholding.py | mozbatman/Basic-Opencv-Example | e00aab203064e3e0f225c6aa062997aabe05ccdb | [
"MIT"
] | null | null | null | image-manipulation-processing/thresholding.py | mozbatman/Basic-Opencv-Example | e00aab203064e3e0f225c6aa062997aabe05ccdb | [
"MIT"
] | null | null | null | ## Thresholding = Giriş olarak verilen görüntüyü ikili görüntüye çevirmek için kullanılan bir yöntemdir. İkili görüntü (binary), görüntünün siyah ve beyaz olarak tanımlanmasıdır.
# Morfolojik operatörler gibi görüntü üzerindeki gürültüleri azaltmak veya nesne belirlemek gibi farklı amaçlar için kullanılır.
import cv2... | 38.015873 | 179 | 0.746555 | cv2.imshow('1 Threshold Binary', thresh1)
ret,thresh2 = cv2.threshold(image, 127, 255, cv2.THRESH_BINARY_INV)
cv2.imshow('2 Threshold Binary Inverse', thresh2)
ret,thresh3 = cv2.threshold(image, 127, 255, cv2.THRESH_TRUNC)
cv2.imshow('3 THRESH TRUNC', thresh3)
ret,thresh4 = cv2.threshold(image, 127, 255, cv2.THRE... | true | true |
f726110264ab39655e21d921ad0fde90f93c841c | 15,517 | py | Python | face_alignment/FaceLandmarksDataset.py | Efreeto/face-alignment | d496866ac3d66c8353ba3e0305f16ac8a2ccc017 | [
"BSD-3-Clause"
] | 2 | 2018-03-22T01:46:49.000Z | 2020-11-06T06:58:01.000Z | face_alignment/FaceLandmarksDataset.py | Efreeto/face-alignment | d496866ac3d66c8353ba3e0305f16ac8a2ccc017 | [
"BSD-3-Clause"
] | null | null | null | face_alignment/FaceLandmarksDataset.py | Efreeto/face-alignment | d496866ac3d66c8353ba3e0305f16ac8a2ccc017 | [
"BSD-3-Clause"
] | null | null | null | import torch
from torch.utils.data import Dataset
from skimage import io, color, transform
import torchvision
import os, glob
import numpy as np
import random
from scipy import ndimage
from PIL import Image
import torch.nn.functional as F
from . import utils
###########################################################... | 40.620419 | 128 | 0.577431 | import torch
from torch.utils.data import Dataset
from skimage import io, color, transform
import torchvision
import os, glob
import numpy as np
import random
from scipy import ndimage
from PIL import Image
import torch.nn.functional as F
from . import utils
rn image
alpha = image.new().resize_(3).normal_(0,... | true | true |
f726125525cfe331ad2b253c9640d4eea089106b | 19,878 | py | Python | swift3/s3_token_middleware.py | AymericDu/swift3 | a64be4ed9c6657fc5471e87e08e6c7465b7bd444 | [
"Apache-2.0"
] | 10 | 2017-04-21T13:56:48.000Z | 2022-03-29T17:15:40.000Z | swift3/s3_token_middleware.py | AymericDu/swift3 | a64be4ed9c6657fc5471e87e08e6c7465b7bd444 | [
"Apache-2.0"
] | 12 | 2017-05-04T16:23:35.000Z | 2021-09-08T16:42:58.000Z | swift3/s3_token_middleware.py | AymericDu/swift3 | a64be4ed9c6657fc5471e87e08e6c7465b7bd444 | [
"Apache-2.0"
] | 10 | 2017-05-10T14:00:42.000Z | 2019-10-28T13:24:57.000Z | # Copyright 2012 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011,2012 Akira YOSHIYAMA <akirayoshiyama@gmail.com>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "Lic... | 43.784141 | 79 | 0.574203 |
import base64
import json
from keystoneclient.v3 import client as keystone_client
from keystoneauth1 import session as keystone_session
from keystoneauth1 import loading as keystone_loading
import requests
import httplib
import six
from six.moves import urllib
from swift.common.swob import Reque... | true | true |
f726129b2b4b6cf86775da7c613d9ac7bd8cbcd9 | 1,396 | py | Python | exploit/cms_discuzx_3_2_authority_bypass.py | Micr067/pentestdb | 6aa06e1406589567d51ab63a88bfe47416e906e9 | [
"Apache-2.0"
] | 686 | 2016-02-06T15:11:12.000Z | 2022-03-30T10:55:29.000Z | exploit/cms_discuzx_3_2_authority_bypass.py | WinDyXuu/pentestdb | 6aa06e1406589567d51ab63a88bfe47416e906e9 | [
"Apache-2.0"
] | 6 | 2016-08-14T15:13:31.000Z | 2020-03-03T14:01:28.000Z | exploit/cms_discuzx_3_2_authority_bypass.py | WinDyXuu/pentestdb | 6aa06e1406589567d51ab63a88bfe47416e906e9 | [
"Apache-2.0"
] | 284 | 2015-12-19T07:42:05.000Z | 2022-03-13T11:58:38.000Z | #!/usr/bin/env python
#-*- coding:utf-8 -*-
'''
Pentestdb, a database for penetration test.
Copyright (c) 2015 alpha1e0
'''
from pentest.libs.exploit import Exploit
from pentest.libs.exploit import Result
class DiscuzAB(Exploit):
expName = u"DiscuzX 3.2绕过虚拟币支付查看内容"
version = "1.0"
author = "alpha1e0"
... | 29.702128 | 193 | 0.62894 |
from pentest.libs.exploit import Exploit
from pentest.libs.exploit import Result
class DiscuzAB(Exploit):
expName = u"DiscuzX 3.2绕过虚拟币支付查看内容"
version = "1.0"
author = "alpha1e0"
language = "php"
appName = "discuz"
appVersion = "x3.2"
reference = ['http://www.secpulse.com/archives/333... | true | true |
f72613e5e98b0d452caf3c66a76ef87d7056fcbc | 650 | py | Python | 006_pycoingecko_intro/app.py | peterhaasme/100daysofweb3 | 5d41ef2261733766c4b19e42cc8a9e6c4b52c75c | [
"Unlicense"
] | 1 | 2022-02-18T04:05:33.000Z | 2022-02-18T04:05:33.000Z | 006_pycoingecko_intro/app.py | peterhaasme/100daysofweb3 | 5d41ef2261733766c4b19e42cc8a9e6c4b52c75c | [
"Unlicense"
] | null | null | null | 006_pycoingecko_intro/app.py | peterhaasme/100daysofweb3 | 5d41ef2261733766c4b19e42cc8a9e6c4b52c75c | [
"Unlicense"
] | null | null | null | # 006_pycoingecko_intro
# explore pycoingecko usage
import json
from pprint import pprint
from pycoingecko import CoinGeckoAPI
cg = CoinGeckoAPI()
# Check API server status
ping = cg.ping()
pprint(ping)
# Get coin price
coin_price = cg.get_price(ids='bitcoin', vs_currencies='usd')
pprint(coin_price)
# Save all sup... | 22.413793 | 61 | 0.741538 |
import json
from pprint import pprint
from pycoingecko import CoinGeckoAPI
cg = CoinGeckoAPI()
ping = cg.ping()
pprint(ping)
coin_price = cg.get_price(ids='bitcoin', vs_currencies='usd')
pprint(coin_price)
| true | true |
f72614a99c832ad2bc453e1394d9ab2f30537e5f | 30,583 | py | Python | nni/tools/nnictl/legacy_launcher.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | null | null | null | nni/tools/nnictl/legacy_launcher.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | null | null | null | nni/tools/nnictl/legacy_launcher.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import json
import os
from pathlib import Path
import sys
import string
import random
import time
import tempfile
import re
from subprocess import Popen, check_call, CalledProcessError, PIPE, STDOUT
from nni.experiment.config import ExperimentCon... | 49.647727 | 140 | 0.688552 |
import json
import os
from pathlib import Path
import sys
import string
import random
import time
import tempfile
import re
from subprocess import Popen, check_call, CalledProcessError, PIPE, STDOUT
from nni.experiment.config import ExperimentConfig, convert
from nni.tools.annotation import expand_annotations, gener... | true | true |
f7261540ddd2002ae7277a840f8220797a974449 | 1,398 | py | Python | homeassistant/components/light/isy994.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | 1 | 2016-07-14T05:20:54.000Z | 2016-07-14T05:20:54.000Z | homeassistant/components/light/isy994.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | null | null | null | homeassistant/components/light/isy994.py | beschouten/home-assistant | f50c30bbbad4d92e342c8547630c63c0c7882803 | [
"MIT"
] | 1 | 2018-11-22T13:55:23.000Z | 2018-11-22T13:55:23.000Z | """
Support for ISY994 lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/isy994/
"""
import logging
from homeassistant.components.isy994 import (
HIDDEN_STRING, ISY, SENSOR_STRING, ISYDeviceABC)
from homeassistant.components.light import ATTR_B... | 29.125 | 77 | 0.690272 | import logging
from homeassistant.components.isy994 import (
HIDDEN_STRING, ISY, SENSOR_STRING, ISYDeviceABC)
from homeassistant.components.light import ATTR_BRIGHTNESS
from homeassistant.const import STATE_OFF, STATE_ON
def setup_platform(hass, config, add_devices, discovery_info=None):
logger = logging.get... | true | true |
f72615697ea7f0f72fe65505596ea4f2e3766a64 | 879 | py | Python | BAIT2123 Internet Of Things/Practical/Practical 7/test10.py | loozixuan/SoftwareSystemsDevelopment-Y2S1 | 98c74d191ad5655277b28849d0f63cd0400cee25 | [
"MIT"
] | 3 | 2021-12-22T11:23:45.000Z | 2022-01-06T04:31:08.000Z | BAIT2123 Internet Of Things/Practical/Practical 7/test10.py | loozixuan/SoftwareSystemsDevelopment-Y2S1 | 98c74d191ad5655277b28849d0f63cd0400cee25 | [
"MIT"
] | null | null | null | BAIT2123 Internet Of Things/Practical/Practical 7/test10.py | loozixuan/SoftwareSystemsDevelopment-Y2S1 | 98c74d191ad5655277b28849d0f63cd0400cee25 | [
"MIT"
] | null | null | null | #from time import *
from grovepi import *
from paho.mqtt.client import *
buzzer = 3
pinMode(buzzer, "OUTPUT")
MQTT_BROKER = "192.168.56.1" #The ip address will be vary based on where and how you connect to the Internet
#MQTT_BROKER = "broker.emqx.io" #using public mqtt broker to act as subsriber
MQTT_TOPIC =... | 29.3 | 109 | 0.653015 |
from grovepi import *
from paho.mqtt.client import *
buzzer = 3
pinMode(buzzer, "OUTPUT")
MQTT_BROKER = "192.168.56.1"
userdata, flags, rc):
print("Connected with result code " + str(rc))
client.subscribe(MQTT_TOPIC)
def on_message(client, userdata, msg):
print(msg.topic + " " + str(msg... | true | true |
f7261569a905f945bb952e0e026fd7beb779ab12 | 491 | py | Python | examples/10_write_simple.py | drbitboy/pylogix | 6204f8e288276f407763d56fa0801355daf115a6 | [
"Apache-2.0"
] | 350 | 2016-07-26T20:50:26.000Z | 2022-03-28T09:22:33.000Z | examples/10_write_simple.py | drbitboy/pylogix | 6204f8e288276f407763d56fa0801355daf115a6 | [
"Apache-2.0"
] | 175 | 2016-11-16T21:39:25.000Z | 2022-03-15T04:40:00.000Z | examples/10_write_simple.py | drbitboy/pylogix | 6204f8e288276f407763d56fa0801355daf115a6 | [
"Apache-2.0"
] | 174 | 2016-07-25T20:51:37.000Z | 2022-03-30T01:29:03.000Z | '''
the following import is only necessary because eip is not in this directory
'''
import sys
sys.path.append('..')
'''
The simplest example of writing a tag from a PLC
NOTE: You only need to call .Close() after you are done exchanging
data with the PLC. If you were going to read/write in a loop or read/write
more... | 24.55 | 75 | 0.723014 | import sys
sys.path.append('..')
from pylogix import PLC
comm = PLC()
comm.IPAddress = '192.168.1.9'
comm.Write('CurrentScreen', 10)
comm.Close()
| true | true |
f7261575ae40a5abf038212e2c31908273819413 | 745 | py | Python | app/urls.py | forestbaba/recipe-app-api | 72471dd6a8ad5993a71ae6648026d0d1def5d03d | [
"MIT"
] | 11 | 2018-06-19T01:32:59.000Z | 2022-01-28T13:41:20.000Z | app/urls.py | forestbaba/recipe-app-api | 72471dd6a8ad5993a71ae6648026d0d1def5d03d | [
"MIT"
] | 8 | 2019-06-11T02:44:04.000Z | 2022-02-10T11:55:20.000Z | app/urls.py | forestbaba/recipe-app-api | 72471dd6a8ad5993a71ae6648026d0d1def5d03d | [
"MIT"
] | 2 | 2020-07-04T14:14:46.000Z | 2021-10-04T11:22:50.000Z | """app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | 33.863636 | 77 | 0.707383 | from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
]
| true | true |
f72615d8349f0df9ace6524c51601bcc14b49239 | 1,472 | py | Python | toTheMoon/leetcode_115_DistinctSubsequences.py | jercas/offer66-leetcode-newcode | a2e5256f27dbfb23fc34119fc857cd9b00e28c03 | [
"MIT"
] | null | null | null | toTheMoon/leetcode_115_DistinctSubsequences.py | jercas/offer66-leetcode-newcode | a2e5256f27dbfb23fc34119fc857cd9b00e28c03 | [
"MIT"
] | null | null | null | toTheMoon/leetcode_115_DistinctSubsequences.py | jercas/offer66-leetcode-newcode | a2e5256f27dbfb23fc34119fc857cd9b00e28c03 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 15 15:37:49 2019
@author: jercas
"""
"""
leetcode-115: 不同的子序列 HARD
'动态规划' '字符串'
给定一个字符串 S 和一个字符串 T,计算在 S 的子序列中 T 出现的个数。
一个字符串的一个子序列是指,通过删除一些(也可以不删除)字符且不干扰剩余字符相对位置所组成的新字符串。
(例如,"ACE" 是 "ABCDE" 的一个子序列,而 "AEC" 不是)
___ 0
... | 29.44 | 75 | 0.432745 |
class Solution:
def numDistinct(self, s: str, t: str) -> int:
dictTimes = {}
dictChars = {}
for i in range(len(t)):
if t[i] in dictChars:
dictChars[t[i]].append(t[:i])
else:
dictChars[t[i]] = [t[:i]]
for i in range(1, ... | true | true |
f72615e0cd1ac3bf0fced183806639408d1edf2d | 3,061 | py | Python | getdoi/getDOIFromURL/science.py | YutoMizutani/getdoi | cf4e1a2bebe2d6cd9f534221a965d6153974f495 | [
"MIT"
] | null | null | null | getdoi/getDOIFromURL/science.py | YutoMizutani/getdoi | cf4e1a2bebe2d6cd9f534221a965d6153974f495 | [
"MIT"
] | null | null | null | getdoi/getDOIFromURL/science.py | YutoMizutani/getdoi | cf4e1a2bebe2d6cd9f534221a965d6153974f495 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# === About ============================================================================================================
"""
science.py
Copyright © 2017 Yuto Mizutani.
This software is released under the MIT License.
Version: 1.0.0
TranslateAuthors: Yuto Mizutani
E-mail: ... | 32.913978 | 120 | 0.49951 |
from .gettableDOI import GettableDOI
from getdoi.scraping.beautifulSoupModel import BeautifulSoupModelImpl
class Science(GettableDOI):
JOURNAL_URL = 'science.sciencemag.org'
JOURNAL_STR = 'Science'
DOI_KEY = 'DOI: '
DOI_URL = "https://doi.org/"
DOI_STR = 'doi: '
... | true | true |
f72616177243550a1e3e7b68785b0d0fd43a39d3 | 8,412 | py | Python | Intent Recognition Protoype/app.py | AndBuch/intent-recognition-for-dialogs | 1a0bdfc8f36cf31e097a662c86f671bb5c820bc1 | [
"MIT"
] | null | null | null | Intent Recognition Protoype/app.py | AndBuch/intent-recognition-for-dialogs | 1a0bdfc8f36cf31e097a662c86f671bb5c820bc1 | [
"MIT"
] | null | null | null | Intent Recognition Protoype/app.py | AndBuch/intent-recognition-for-dialogs | 1a0bdfc8f36cf31e097a662c86f671bb5c820bc1 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, url_for, request, redirect, session
from flask_sqlalchemy import SQLAlchemy
import uuid
import wave
from flask_socketio import emit, SocketIO
from datetime import datetime
import database_custom
import os
# Set this variable to "threading", "eventlet" or "gevent" to test the... | 30.042857 | 133 | 0.526153 | from flask import Flask, render_template, url_for, request, redirect, session
from flask_sqlalchemy import SQLAlchemy
import uuid
import wave
from flask_socketio import emit, SocketIO
from datetime import datetime
import database_custom
import os
async_mode = None
dir_path = os.path.dirname(os.path.realpath(__f... | true | true |
f72616de29779e50da24b38a39bb7a37b89fe8df | 325 | py | Python | p_var.py | PacktPublishing/Packt | 790c5a01eba5979ba4f22392538197981cb10447 | [
"MIT"
] | null | null | null | p_var.py | PacktPublishing/Packt | 790c5a01eba5979ba4f22392538197981cb10447 | [
"MIT"
] | null | null | null | p_var.py | PacktPublishing/Packt | 790c5a01eba5979ba4f22392538197981cb10447 | [
"MIT"
] | null | null | null | class car:
__topspeed = 0
__name=""
def __init__(self):
self.__topspeed=250
self.name="SAM"
def drive(self):
print("Drive Top Speed=" +str(self.__topspeed))
def setTopSpeed(self,speed):
self.__topspeed=speed
volvo=car()
volvo.drive()
volvo.setTopSpeed(380)
volvo.dr... | 17.105263 | 55 | 0.627692 | class car:
__topspeed = 0
__name=""
def __init__(self):
self.__topspeed=250
self.name="SAM"
def drive(self):
print("Drive Top Speed=" +str(self.__topspeed))
def setTopSpeed(self,speed):
self.__topspeed=speed
volvo=car()
volvo.drive()
volvo.setTopSpeed(380)
volvo.dr... | true | true |
f72616faa0a3c1aea2a3297fcae2f7c444a7134b | 12,820 | py | Python | octopus/modules/oag/client.py | CottageLabs/magnificent-octopus-oacwellcome-fork | b1c8c412cf9a3fe66fca1c8e92ed074c9821663e | [
"Apache-2.0"
] | 2 | 2016-02-22T04:31:30.000Z | 2021-08-03T23:58:36.000Z | octopus/modules/oag/client.py | CottageLabs/magnificent-octopus-oacwellcome-fork | b1c8c412cf9a3fe66fca1c8e92ed074c9821663e | [
"Apache-2.0"
] | 9 | 2015-01-04T14:00:05.000Z | 2021-12-13T19:35:07.000Z | octopus/modules/oag/client.py | CottageLabs/magnificent-octopus-oacwellcome-fork | b1c8c412cf9a3fe66fca1c8e92ed074c9821663e | [
"Apache-2.0"
] | 3 | 2016-09-09T13:39:45.000Z | 2018-02-19T14:23:12.000Z | from datetime import datetime, timedelta
import json, requests, time, sys, uuid
from copy import deepcopy
from octopus.core import app
from octopus.lib import http
class RequestState(object):
_timestamp_format = "%Y-%m-%dT%H:%M:%SZ"
def __init__(self, identifiers, timeout=None, back_off_factor=None, max_back_... | 36.628571 | 162 | 0.569501 | from datetime import datetime, timedelta
import json, requests, time, sys, uuid
from copy import deepcopy
from octopus.core import app
from octopus.lib import http
class RequestState(object):
_timestamp_format = "%Y-%m-%dT%H:%M:%SZ"
def __init__(self, identifiers, timeout=None, back_off_factor=None, max_back_... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.