hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c330f8a6990fea6359bab8467d42ea370ce5742 | 1,504 | py | Python | accountifie/common/log.py | imcallister/accountifie | 094834c9d632e0353e3baf8d924eeb10cba0add4 | [
"MIT",
"Unlicense"
] | 4 | 2017-06-02T08:48:48.000Z | 2021-11-21T23:57:15.000Z | accountifie/common/log.py | imcallister/accountifie | 094834c9d632e0353e3baf8d924eeb10cba0add4 | [
"MIT",
"Unlicense"
] | 3 | 2020-06-05T16:55:42.000Z | 2021-06-10T17:43:12.000Z | accountifie/common/log.py | imcallister/accountifie | 094834c9d632e0353e3baf8d924eeb10cba0add4 | [
"MIT",
"Unlicense"
] | 4 | 2015-12-15T14:27:51.000Z | 2017-04-21T21:42:27.000Z | """
Partially adapted with permission from ReportLab's DocEngine framework
"""
import requests
import logging
import json
import traceback
from django.views.debug import get_exception_reporter_filter
from django.conf import settings
class DbLogHandler(logging.Handler):
def emit(self, record):
from .mod... | 29.490196 | 81 | 0.62367 |
import requests
import logging
import json
import traceback
from django.views.debug import get_exception_reporter_filter
from django.conf import settings
class DbLogHandler(logging.Handler):
def emit(self, record):
from .models import Log, Issue
try:
request = record.request
... | true | true |
1c3310046683c750c56af215bc29b813ac883595 | 19,959 | py | Python | zipline/algorithm.py | davidastephens/zipline | 1da206df936bb8125913bae9fc182fd4f611a691 | [
"Apache-2.0"
] | 2 | 2015-12-10T16:25:10.000Z | 2016-02-17T00:18:38.000Z | zipline/algorithm.py | davidastephens/zipline | 1da206df936bb8125913bae9fc182fd4f611a691 | [
"Apache-2.0"
] | null | null | null | zipline/algorithm.py | davidastephens/zipline | 1da206df936bb8125913bae9fc182fd4f611a691 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2013 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 36.488117 | 79 | 0.628288 | from copy import copy
import pytz
import pandas as pd
import numpy as np
from datetime import datetime
from itertools import groupby, ifilter
from operator import attrgetter
from zipline.errors import (
UnsupportedSlippageModel,
OverrideSlippagePostInit,
UnsupportedCommissionModel,
OverrideCommissio... | true | true |
1c3310438ac0db658cd7671f27d9557f80502ddf | 691 | py | Python | extract_text_from_pics.py | Jrfix/Extract_Text_From_Pics | d72fca954fd2e1663b3a40c8005f45b6876daf72 | [
"MIT"
] | 1 | 2019-06-05T22:25:14.000Z | 2019-06-05T22:25:14.000Z | extract_text_from_pics.py | Jrfix/Extract_Text_From_Pics | d72fca954fd2e1663b3a40c8005f45b6876daf72 | [
"MIT"
] | null | null | null | extract_text_from_pics.py | Jrfix/Extract_Text_From_Pics | d72fca954fd2e1663b3a40c8005f45b6876daf72 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from PIL import Image
from pytesseract import image_to_string
import sys
import os
import time
from time import sleep
print("Example --> /root/Desktop/")
image_path = raw_input("Image path: ")
print("Example --> picture.png")
image_name = raw_input("Image name: ")
os.s... | 13.288462 | 48 | 0.671491 |
from PIL import Image
from pytesseract import image_to_string
import sys
import os
import time
from time import sleep
print("Example --> /root/Desktop/")
image_path = raw_input("Image path: ")
print("Example --> picture.png")
image_name = raw_input("Image name: ")
os.system("clear")
img = Image.open(image_p... | true | true |
1c331071f4bf4f4c900885a34d173bfff95f2e89 | 2,832 | py | Python | setup.py | aryabhatt/autocorr-1 | dd47b01498be68d2cd1557b620bc68f4b76c3e11 | [
"BSD-3-Clause"
] | null | null | null | setup.py | aryabhatt/autocorr-1 | dd47b01498be68d2cd1557b620bc68f4b76c3e11 | [
"BSD-3-Clause"
] | null | null | null | setup.py | aryabhatt/autocorr-1 | dd47b01498be68d2cd1557b620bc68f4b76c3e11 | [
"BSD-3-Clause"
] | null | null | null | from os import path
from setuptools import setup, find_packages, Extension
import sys
import versioneer
min_pybind11_version = (2, 3)
# NOTE: This file must remain Python 2 compatible for the foreseeable future,
# to ensure that we error out properly for people with outdated setuptools
# and/or pip.
min_version = (3,... | 31.120879 | 82 | 0.667726 | from os import path
from setuptools import setup, find_packages, Extension
import sys
import versioneer
min_pybind11_version = (2, 3)
min_version = (3, 6)
if sys.version_info < min_version:
error = """
autocorr does not support Python {0}.{1}.
Python {2}.{3} and above is required. Check your Python version like s... | true | true |
1c331147ea30befa010f9a880e04c012fd77ed69 | 2,469 | py | Python | spam.py | redhood-97/sms.ai | 8b787e3f678003826e36e233d966c7108989354c | [
"MIT"
] | null | null | null | spam.py | redhood-97/sms.ai | 8b787e3f678003826e36e233d966c7108989354c | [
"MIT"
] | null | null | null | spam.py | redhood-97/sms.ai | 8b787e3f678003826e36e233d966c7108989354c | [
"MIT"
] | 3 | 2018-05-31T07:04:06.000Z | 2018-10-30T17:42:07.000Z |
import os, csv, re, nltk
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.f... | 20.404959 | 114 | 0.611989 |
import os, csv, re, nltk
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.f... | true | true |
1c3312ed599f7e848d662a175adb396479227a15 | 4,281 | py | Python | set3/CBC_padding_oracle.py | nahgil2614/cryptopals | e1c83d07dacb1c159ab1bbc0532eca8200dedca0 | [
"MIT"
] | null | null | null | set3/CBC_padding_oracle.py | nahgil2614/cryptopals | e1c83d07dacb1c159ab1bbc0532eca8200dedca0 | [
"MIT"
] | null | null | null | set3/CBC_padding_oracle.py | nahgil2614/cryptopals | e1c83d07dacb1c159ab1bbc0532eca8200dedca0 | [
"MIT"
] | null | null | null | import base64
import random
import time
from PKCS7 import valid_pad
from PKCS7 import PKCS7_pad as pad
from AES_CBC import Ciphers
from AES_CBC import InvCiphers
from AES_CBC import KeyExpansion
#const
randKey = bytes([random.getrandbits(8) for i in range(16)])
w = KeyExpansion( randKey )
IV = ''.join([c... | 32.679389 | 97 | 0.512731 | import base64
import random
import time
from PKCS7 import valid_pad
from PKCS7 import PKCS7_pad as pad
from AES_CBC import Ciphers
from AES_CBC import InvCiphers
from AES_CBC import KeyExpansion
randKey = bytes([random.getrandbits(8) for i in range(16)])
w = KeyExpansion( randKey )
IV = ''.join([chr(rando... | true | true |
1c3314374f8fb01f613de63c5fa967af3b8e0188 | 7,367 | py | Python | trainer/loss.py | keshav47/mildnet | c5a95da78039bea605b75ce3ed2af6fe310f36f6 | [
"Apache-2.0"
] | 77 | 2019-03-07T12:18:47.000Z | 2022-03-28T08:21:55.000Z | trainer/loss.py | keshav47/mildnet | c5a95da78039bea605b75ce3ed2af6fe310f36f6 | [
"Apache-2.0"
] | 23 | 2019-05-17T11:23:02.000Z | 2022-03-11T23:42:29.000Z | trainer/loss.py | keshav47/mildnet | c5a95da78039bea605b75ce3ed2af6fe310f36f6 | [
"Apache-2.0"
] | 29 | 2019-03-11T02:41:42.000Z | 2022-02-07T15:37:24.000Z | from tensorflow.keras import backend as K
import tensorflow as tf
_EPSILON = K.epsilon()
def hinge_loss_fn(batch_size):
def hinge_loss(y_true, y_pred):
y_pred = K.clip(y_pred, _EPSILON, 1.0-_EPSILON)
loss = tf.convert_to_tensor(0,dtype=tf.float32)
g = tf.constant(1.0, shape=[1], dtype=tf.... | 38.570681 | 109 | 0.539297 | from tensorflow.keras import backend as K
import tensorflow as tf
_EPSILON = K.epsilon()
def hinge_loss_fn(batch_size):
def hinge_loss(y_true, y_pred):
y_pred = K.clip(y_pred, _EPSILON, 1.0-_EPSILON)
loss = tf.convert_to_tensor(0,dtype=tf.float32)
g = tf.constant(1.0, shape=[1], dtype=tf.... | true | true |
1c3314cfa907a66f629e785eaa51462cbe241442 | 1,072 | py | Python | src/base.py | DrFargo/Starship-Simulation | ff1c30cd8227c7041357a1e2da2fcb34ab06a757 | [
"MIT"
] | null | null | null | src/base.py | DrFargo/Starship-Simulation | ff1c30cd8227c7041357a1e2da2fcb34ab06a757 | [
"MIT"
] | null | null | null | src/base.py | DrFargo/Starship-Simulation | ff1c30cd8227c7041357a1e2da2fcb34ab06a757 | [
"MIT"
] | null | null | null | ## Author DrFargo
## Created: 2021-02-07
## Latest update: 2021-02-12
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import scipy.linalg as la
import matplotlib.pyplot as plt
class starshipSimulation:
def parameters(self, g, lox, engines):
gravity = g
tlo... | 26.146341 | 45 | 0.545709 |
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import scipy.linalg as la
import matplotlib.pyplot as plt
class starshipSimulation:
def parameters(self, g, lox, engines):
gravity = g
tlox = lox
rapteng = engines*2.3
m_fuel = 1.8
m_o... | true | true |
1c331613d3b8ca181851d6b069742635a6769333 | 1,134 | py | Python | bot/cogs/Cogs/__init__.py | abindent/Utility-Bot | a11b790e7930a035fdca2b153950e624e3abafe4 | [
"MIT"
] | 2 | 2022-03-20T13:12:35.000Z | 2022-03-27T08:52:37.000Z | bot/cogs/Cogs/__init__.py | abindent/Nextcord-Utility-Bot | a11b790e7930a035fdca2b153950e624e3abafe4 | [
"MIT"
] | 2 | 2022-03-07T01:10:21.000Z | 2022-03-08T07:33:06.000Z | bot/cogs/Cogs/__init__.py | abindent/Utility-Bot | a11b790e7930a035fdca2b153950e624e3abafe4 | [
"MIT"
] | 1 | 2022-03-08T07:41:46.000Z | 2022-03-08T07:41:46.000Z | import nextcord
from nextcord.ext import commands
class CogSetup(commands.Cog, name="Extension Setup", description="Load, Unload or Reload the extensions."):
def __init__(self, bot):
self.bot = bot
COG_EMOJI = "⚙️"
# Load Command
@commands.command(name="load", description="Load t... | 34.363636 | 107 | 0.663139 | import nextcord
from nextcord.ext import commands
class CogSetup(commands.Cog, name="Extension Setup", description="Load, Unload or Reload the extensions."):
def __init__(self, bot):
self.bot = bot
COG_EMOJI = "⚙️"
@commands.command(name="load", description="Load the cogs.", usag... | true | true |
1c331618c8fa5a71c5b4d40f6f354c23efb05154 | 601 | py | Python | AtCoder/ABC045/D.py | takaaki82/Java-Lessons | c4f11462bf84c091527dde5f25068498bfb2cc49 | [
"MIT"
] | 1 | 2018-11-25T04:15:45.000Z | 2018-11-25T04:15:45.000Z | AtCoder/ABC045/D.py | takaaki82/Java-Lessons | c4f11462bf84c091527dde5f25068498bfb2cc49 | [
"MIT"
] | null | null | null | AtCoder/ABC045/D.py | takaaki82/Java-Lessons | c4f11462bf84c091527dde5f25068498bfb2cc49 | [
"MIT"
] | 2 | 2018-08-08T13:01:14.000Z | 2018-11-25T12:38:36.000Z | H, W, N = map(int, input().split())
ab = []
for i in range(N):
a, b = map(int, input().split())
ab.append((a - 1, b - 1))
comb_map = {}
for a, b in ab:
for k in range(3):
for m in range(3):
if 0 <= a - k < H - 2 and 0 <= b - m < W - 2:
if (a - k, b - m) in comb_map.keys... | 22.259259 | 57 | 0.417637 | H, W, N = map(int, input().split())
ab = []
for i in range(N):
a, b = map(int, input().split())
ab.append((a - 1, b - 1))
comb_map = {}
for a, b in ab:
for k in range(3):
for m in range(3):
if 0 <= a - k < H - 2 and 0 <= b - m < W - 2:
if (a - k, b - m) in comb_map.keys... | true | true |
1c331652aac3fe02dca4d80a87a46912b21c30c3 | 5,214 | py | Python | installation/migrations/dbschema.files-and-directories.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | 216 | 2015-01-05T12:48:10.000Z | 2022-03-08T00:12:23.000Z | installation/migrations/dbschema.files-and-directories.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | 55 | 2015-02-28T12:10:26.000Z | 2020-11-18T17:45:16.000Z | installation/migrations/dbschema.files-and-directories.py | fekblom/critic | a6b60c9053e13d4c878d50531860d7389568626d | [
"Apache-2.0"
] | 34 | 2015-05-02T15:15:10.000Z | 2020-06-15T19:20:37.000Z | # -*- mode: python; encoding: utf-8 -*-
#
# Copyright 2013 Jens Lindström, Opera Software ASA
#
# 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... | 40.418605 | 116 | 0.75163 |
import sys
import psycopg2
import json
import argparse
import os
parser = argparse.ArgumentParser()
parser.add_argument("--uid", type=int)
parser.add_argument("--gid", type=int)
arguments = parser.parse_args()
os.setgid(arguments.gid)
os.setuid(arguments.uid)
data = json.load(sys.stdin)
import configuration
db =... | true | true |
1c3316737fce0dbb30450130ad8d0edd48534733 | 1,194 | py | Python | setup.py | bentetamas/tinycards-python-api | 98c35c8b1fbad28fcc61c01cbdae7e092e779a62 | [
"MIT"
] | null | null | null | setup.py | bentetamas/tinycards-python-api | 98c35c8b1fbad28fcc61c01cbdae7e092e779a62 | [
"MIT"
] | null | null | null | setup.py | bentetamas/tinycards-python-api | 98c35c8b1fbad28fcc61c01cbdae7e092e779a62 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
NAME = 'tinycards'
setup(
name=NAME,
version='0.281',
description="An unofficial Python API for Tinycards by Duolingo",
url='https://github.com/floscha/tinycards-python-api',
author='Florian Schäfer',
author_email='florian.joh.schaefer@gmail.com',
... | 29.85 | 69 | 0.586265 | from setuptools import setup, find_packages
NAME = 'tinycards'
setup(
name=NAME,
version='0.281',
description="An unofficial Python API for Tinycards by Duolingo",
url='https://github.com/floscha/tinycards-python-api',
author='Florian Schäfer',
author_email='florian.joh.schaefer@gmail.com',
... | true | true |
1c3318416dc8b7805443ceeac11a29cef738ae32 | 1,225 | py | Python | NesaraTours/migrations/0002_auto_20200831_0946.py | Annonymus-Coder/Tours-And-Travels-project | 81fce5c24599895b6526eeb28bd4582b5d55948b | [
"MIT"
] | null | null | null | NesaraTours/migrations/0002_auto_20200831_0946.py | Annonymus-Coder/Tours-And-Travels-project | 81fce5c24599895b6526eeb28bd4582b5d55948b | [
"MIT"
] | null | null | null | NesaraTours/migrations/0002_auto_20200831_0946.py | Annonymus-Coder/Tours-And-Travels-project | 81fce5c24599895b6526eeb28bd4582b5d55948b | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-08-31 04:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('auth', '0012_al... | 32.236842 | 125 | 0.601633 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('auth', '0012_alter_user_first_name_max_length'),
('Ne... | true | true |
1c3318ca5161384c5534f50a78303c641566d024 | 324 | py | Python | redcmd/client/__main__.py | amol9/redcmd | 34086eb42ec6acc16dbd2b3ea530898a6a287639 | [
"MIT"
] | 1 | 2015-10-26T19:38:28.000Z | 2015-10-26T19:38:28.000Z | redcmd/client/__main__.py | amol9/redcmd | 34086eb42ec6acc16dbd2b3ea530898a6a287639 | [
"MIT"
] | null | null | null | redcmd/client/__main__.py | amol9/redcmd | 34086eb42ec6acc16dbd2b3ea530898a6a287639 | [
"MIT"
] | null | null | null |
from .. import CommandLine, CommandLineError, Subcommand, subcmd
from ..version import __version__
from .autocomp_subcommand import *
from .init_subcommand import *
cmdline = CommandLine(prog='redcmd', description='redcmd client.',
version=__version__)
try:
cmdline.execute()
except CommandLineError as e:
print(... | 20.25 | 66 | 0.777778 |
from .. import CommandLine, CommandLineError, Subcommand, subcmd
from ..version import __version__
from .autocomp_subcommand import *
from .init_subcommand import *
cmdline = CommandLine(prog='redcmd', description='redcmd client.',
version=__version__)
try:
cmdline.execute()
except CommandLineError as e:
print(... | true | true |
1c33198acec018137f92a47269f0ef6f6b75370d | 1,323 | py | Python | accounts/forms.py | Paul-Cheeseman/Stream3-Project | 174fa1d6bbf9ed75748513af366629ed01dddfee | [
"BSD-3-Clause"
] | null | null | null | accounts/forms.py | Paul-Cheeseman/Stream3-Project | 174fa1d6bbf9ed75748513af366629ed01dddfee | [
"BSD-3-Clause"
] | 8 | 2020-02-12T00:52:56.000Z | 2022-03-11T23:23:20.000Z | accounts/forms.py | Paul-Cheeseman/Stream3-Project | 174fa1d6bbf9ed75748513af366629ed01dddfee | [
"BSD-3-Clause"
] | 1 | 2018-02-22T11:15:48.000Z | 2018-02-22T11:15:48.000Z | from django import forms
from django.contrib.auth.forms import UserCreationForm
from accounts.models import User
#User Registration form - based on code from Code Institute
class UserRegistrationForm(UserCreationForm):
password1 = forms.CharField(
label='Password',
widget=forms.PasswordInput
)
... | 25.941176 | 74 | 0.662887 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from accounts.models import User
class UserRegistrationForm(UserCreationForm):
password1 = forms.CharField(
label='Password',
widget=forms.PasswordInput
)
password2 = forms.CharField(
label='Password C... | true | true |
1c3319ce9f23f6f47aafb85e691db243fef0398c | 1,738 | py | Python | Gathered CTF writeups/ptr-yudai-writeups/2019/InCTF_2019/schmaltz/solve.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | 1 | 2022-03-27T06:00:41.000Z | 2022-03-27T06:00:41.000Z | Gathered CTF writeups/ptr-yudai-writeups/2019/InCTF_2019/schmaltz/solve.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | null | null | null | Gathered CTF writeups/ptr-yudai-writeups/2019/InCTF_2019/schmaltz/solve.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | 1 | 2022-03-27T06:01:42.000Z | 2022-03-27T06:01:42.000Z | from ptrlib import *
def add(size, data):
sock.sendlineafter("> ", "1")
sock.sendlineafter("> ", str(size))
if size > 0:
sock.sendafter("> ", data)
return
def view(index):
sock.sendlineafter("> ", "3")
sock.sendlineafter("> ", str(index))
sock.recvuntil("Content: ")
return sock... | 22 | 61 | 0.623705 | from ptrlib import *
def add(size, data):
sock.sendlineafter("> ", "1")
sock.sendlineafter("> ", str(size))
if size > 0:
sock.sendafter("> ", data)
return
def view(index):
sock.sendlineafter("> ", "3")
sock.sendlineafter("> ", str(index))
sock.recvuntil("Content: ")
return sock... | true | true |
1c3319d1b95ffbb366d5639dab284adc07453f08 | 641 | py | Python | src/test.py | erikmetzinfo/tds_db_generator | 1082a670f1ecd46c2dc7f0ebe8baccdcaf70a867 | [
"MIT"
] | null | null | null | src/test.py | erikmetzinfo/tds_db_generator | 1082a670f1ecd46c2dc7f0ebe8baccdcaf70a867 | [
"MIT"
] | null | null | null | src/test.py | erikmetzinfo/tds_db_generator | 1082a670f1ecd46c2dc7f0ebe8baccdcaf70a867 | [
"MIT"
] | null | null | null |
from general_pkg import string_comparison
from fuzzywuzzy import process as fuzzy_process
a = 'Ratio by weight ( A / B ) 100/ 9505'
a = 'Ratio by weight ( A / B ) 100/ 9505'
b = 'Ratio by weight ( A / B )'
match, match_ratio = string_comparison(a,b,max_value=95)
def special_string_comparison(string1, string2):
... | 26.708333 | 56 | 0.659906 |
from general_pkg import string_comparison
from fuzzywuzzy import process as fuzzy_process
a = 'Ratio by weight ( A / B ) 100/ 9505'
a = 'Ratio by weight ( A / B ) 100/ 9505'
b = 'Ratio by weight ( A / B )'
match, match_ratio = string_comparison(a,b,max_value=95)
def special_string_comparison(string1, string2):
... | true | true |
1c331a30f7049c48688de08a8d07b2dec8e1d49a | 981 | py | Python | scraper/storage_spiders/thanhhuongshoescom.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | null | null | null | scraper/storage_spiders/thanhhuongshoescom.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 10 | 2020-02-11T23:34:28.000Z | 2022-03-11T23:16:12.000Z | scraper/storage_spiders/thanhhuongshoescom.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 3 | 2018-08-05T14:54:25.000Z | 2021-06-07T01:49:59.000Z | # Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//h1",
'price' : "//em[@class='ProductPrice VariationProductPrice']",
'category' : "//div[@id='Breadcrumb']/ul/li/a",
'descrip... | 36.333333 | 98 | 0.651376 | from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//h1",
'price' : "//em[@class='ProductPrice VariationProductPrice']",
'category' : "//div[@id='Breadcrumb']/ul/li/a",
'description' : "//div[@id='ProductDescription']/div[@class='ProductDescriptionContai... | true | true |
1c331a47640bd205d642269fb7ca24e833c01fa8 | 419 | py | Python | ex011.py | erikamaylim/Python-CursoemVideo | 5a6809818c4c55a02ec52379d95f3d20c833df2e | [
"MIT"
] | null | null | null | ex011.py | erikamaylim/Python-CursoemVideo | 5a6809818c4c55a02ec52379d95f3d20c833df2e | [
"MIT"
] | null | null | null | ex011.py | erikamaylim/Python-CursoemVideo | 5a6809818c4c55a02ec52379d95f3d20c833df2e | [
"MIT"
] | null | null | null | """Faça um programa que leia a largura e a altura de uma parede em metros,
calcule a sua área e a quantidade de tinta necessária para pintá-la,
sabendo que cada litro de tinta pinta uma área de 2 metros quadrados."""
l = float(input('Digite a largura em metros: '))
h = float(input('Digite a altura em metros: '))
a = l... | 41.9 | 83 | 0.699284 |
l = float(input('Digite a largura em metros: '))
h = float(input('Digite a altura em metros: '))
a = l * h
t = a / 2
print('A área tem {:.2f}m² e são necessários {:.2f} litros de tinta.'.format(a, t))
| true | true |
1c331a4818a19d2eb248b16229fc321ce8b19a30 | 10,343 | py | Python | myven/lib/python3.8/site-packages/ansible/modules/cloud/azure/azure_rm_mysqldatabase.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | myven/lib/python3.8/site-packages/ansible/modules/cloud/azure/azure_rm_mysqldatabase.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | null | null | null | myven/lib/python3.8/site-packages/ansible/modules/cloud/azure/azure_rm_mysqldatabase.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 34.824916 | 152 | 0.577202 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: azure_rm_mysqldatabase
version_added: "2.5"
short_descript... | true | true |
1c331b0913f847b13de2e972bc7a00bde2fbf4db | 47,483 | py | Python | jenkins_jobs/modules/project_multibranch.py | knorx/jenkins-job-builder | d15e57a14a7aa6a9de674479e1dcb904a8c09942 | [
"Apache-2.0"
] | 3 | 2019-03-03T20:15:29.000Z | 2020-11-17T18:48:27.000Z | jenkins_jobs/modules/project_multibranch.py | knorx/jenkins-job-builder | d15e57a14a7aa6a9de674479e1dcb904a8c09942 | [
"Apache-2.0"
] | null | null | null | jenkins_jobs/modules/project_multibranch.py | knorx/jenkins-job-builder | d15e57a14a7aa6a9de674479e1dcb904a8c09942 | [
"Apache-2.0"
] | 1 | 2019-02-21T22:59:17.000Z | 2019-02-21T22:59:17.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Joost van der Griendt <joostvdg@gmail.com>
# Copyright (C) 2018 Sorin Sbarnea <ssbarnea@users.noreply.github.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of... | 39.701505 | 79 | 0.582609 |
import collections
import logging
import xml.etree.ElementTree as XML
import jenkins_jobs.modules.base
import jenkins_jobs.modules.helpers as helpers
import six
from jenkins_jobs.modules.scm import git_extensions
from jenkins_jobs.errors import InvalidAttributeError
logger = logging.getLogger(str(__name__))
class... | true | true |
1c331b7cfdd6aa03faae6c1b5bc0b4e9acbe92d9 | 14,571 | py | Python | venv/lib/python3.8/site-packages/statsmodels/sandbox/panel/panelmod.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 6,931 | 2015-01-01T11:41:55.000Z | 2022-03-31T17:03:24.000Z | venv/lib/python3.8/site-packages/statsmodels/sandbox/panel/panelmod.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 6,137 | 2015-01-01T00:33:45.000Z | 2022-03-31T22:53:17.000Z | venv/lib/python3.8/site-packages/statsmodels/sandbox/panel/panelmod.py | johncollinsai/post-high-frequency-data | 88533b0e0afc7e7f82fee1d3ca4b68abc30aaeb4 | [
"MIT"
] | 2,608 | 2015-01-02T21:32:31.000Z | 2022-03-31T07:38:30.000Z | """
Sandbox Panel Estimators
References
-----------
Baltagi, Badi H. `Econometric Analysis of Panel Data.` 4th ed. Wiley, 2008.
"""
from functools import reduce
import numpy as np
from statsmodels.regression.linear_model import GLS
__all__ = ["PanelModel"]
from pandas import Panel
def group(X):
"""
Retu... | 32.966063 | 78 | 0.606135 | from functools import reduce
import numpy as np
from statsmodels.regression.linear_model import GLS
__all__ = ["PanelModel"]
from pandas import Panel
def group(X):
uniq_dict = {}
group = np.zeros(len(X))
for i in range(len(X)):
if not X[i] in uniq_dict:
uniq_dict.update({X[i] : len... | true | true |
1c331bf1d66060169113b764d33287441ab11a06 | 139 | py | Python | InClass/Day24/05.py | walkingtyphoon/Python-workspace | e872bce82b2bac3dd5d809f8576345ccc1c6afb7 | [
"Apache-2.0"
] | null | null | null | InClass/Day24/05.py | walkingtyphoon/Python-workspace | e872bce82b2bac3dd5d809f8576345ccc1c6afb7 | [
"Apache-2.0"
] | null | null | null | InClass/Day24/05.py | walkingtyphoon/Python-workspace | e872bce82b2bac3dd5d809f8576345ccc1c6afb7 | [
"Apache-2.0"
] | null | null | null | value = input("请输入你需要辨别的字符:")
print(value.isdigit())
# 判断是否为数字
print(value.isalpha())
# 判断是否为字母
print(value.isspace())
# 判断是否为空格或者是制表符,空格
| 15.444444 | 29 | 0.726619 | value = input("请输入你需要辨别的字符:")
print(value.isdigit())
print(value.isalpha())
print(value.isspace())
| true | true |
1c331d68032e12d278f28e029f665df346a53f5d | 42,579 | py | Python | django/views/debug.py | skyl/django | 843e7450ddcb820b2bdc6d47d6c4aab9820a46c4 | [
"BSD-3-Clause"
] | 1 | 2021-11-22T17:41:19.000Z | 2021-11-22T17:41:19.000Z | django/views/debug.py | skyl/django | 843e7450ddcb820b2bdc6d47d6c4aab9820a46c4 | [
"BSD-3-Clause"
] | null | null | null | django/views/debug.py | skyl/django | 843e7450ddcb820b2bdc6d47d6c4aab9820a46c4 | [
"BSD-3-Clause"
] | 1 | 2020-06-03T07:55:20.000Z | 2020-06-03T07:55:20.000Z | from __future__ import unicode_literals
import datetime
import os
import re
import sys
import types
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import (HttpResponse, HttpResponseServerError,
HttpResponseNotFound, HttpRequest, build_request_repr)
from d... | 38.324932 | 251 | 0.594307 | from __future__ import unicode_literals
import datetime
import os
import re
import sys
import types
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import (HttpResponse, HttpResponseServerError,
HttpResponseNotFound, HttpRequest, build_request_repr)
from d... | true | true |
1c331d725ab785933f4f8fd885d27ab580d5d5b5 | 34 | py | Python | code/answer_4-2-4.py | KoyanagiHitoshi/AtCoder-Python-Introduction | 6d014e333a873f545b4d32d438e57cf428b10b96 | [
"MIT"
] | 1 | 2022-03-29T13:50:12.000Z | 2022-03-29T13:50:12.000Z | code/answer_4-2-4.py | KoyanagiHitoshi/AtCoder-Python-Introduction | 6d014e333a873f545b4d32d438e57cf428b10b96 | [
"MIT"
] | null | null | null | code/answer_4-2-4.py | KoyanagiHitoshi/AtCoder-Python-Introduction | 6d014e333a873f545b4d32d438e57cf428b10b96 | [
"MIT"
] | null | null | null | S, T = input().split()
print(T+S)
| 11.333333 | 22 | 0.558824 | S, T = input().split()
print(T+S)
| true | true |
1c331d987ad5b34a2b09716f44ad466887f0b6b2 | 2,424 | py | Python | api/blog.py | yezz123/DogeAPI | 91e719ad8f252578728ee2a427fd6b733f0cf2a8 | [
"MIT"
] | 93 | 2021-05-13T00:13:19.000Z | 2022-03-30T03:55:09.000Z | api/blog.py | yezz123/DogeAPI | 91e719ad8f252578728ee2a427fd6b733f0cf2a8 | [
"MIT"
] | 17 | 2021-05-16T14:49:24.000Z | 2021-10-18T23:29:48.000Z | api/blog.py | yezz123/DogeAPI | 91e719ad8f252578728ee2a427fd6b733f0cf2a8 | [
"MIT"
] | 22 | 2021-05-13T08:32:59.000Z | 2022-02-23T13:07:05.000Z | #!/usr/bin/python3
from fastapi import HTTPException, status
from sqlalchemy.orm import Session
from models import models
from schema import schemas
def get_all(db: Session):
"""
Get all blogs
Args:
db (Session): Database session
Returns:
List[models.Blog]: List of blogs
"""
... | 21.263158 | 88 | 0.604373 |
from fastapi import HTTPException, status
from sqlalchemy.orm import Session
from models import models
from schema import schemas
def get_all(db: Session):
return db.query(models.Blog).all()
def create(request: schemas.Blog, db: Session):
new_blog = models.Blog(title=request.title, body=request.body, user... | true | true |
1c331dc6c1d546c5e719dd970de5dc96e49ca31d | 4,429 | py | Python | art/defences/thermometer_encoding.py | lr2582858/adversarial-robustness-toolbox | ee3b7ac1ef21fcfd21501070aff2f8eb9db70301 | [
"MIT"
] | 1 | 2018-11-23T06:44:43.000Z | 2018-11-23T06:44:43.000Z | art/defences/thermometer_encoding.py | lr2582858/adversarial-robustness-toolbox | ee3b7ac1ef21fcfd21501070aff2f8eb9db70301 | [
"MIT"
] | null | null | null | art/defences/thermometer_encoding.py | lr2582858/adversarial-robustness-toolbox | ee3b7ac1ef21fcfd21501070aff2f8eb9db70301 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (C) IBM Corporation 2018
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge... | 36.908333 | 120 | 0.665613 | from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import numpy as np
from art.defences.preprocessor import Preprocessor
from art.utils import to_categorical
from art import NUMPY_DTYPE
logger = logging.getLogger(__name__)
class ThermometerEncoding(Preprocessor):
... | true | true |
1c331ddb1997d4e4af5fb713910dc8fbb5641f67 | 1,129 | py | Python | girder/molecules/molecules/utilities/pagination.py | bnmajor/mongochemserver | aa76ab6e7f749c3e893f27e208984b6ed2d4b2b5 | [
"BSD-3-Clause"
] | 14 | 2015-05-04T16:40:48.000Z | 2021-07-13T08:00:30.000Z | girder/molecules/molecules/utilities/pagination.py | bnmajor/mongochemserver | aa76ab6e7f749c3e893f27e208984b6ed2d4b2b5 | [
"BSD-3-Clause"
] | 88 | 2015-07-24T07:58:43.000Z | 2021-02-23T19:37:13.000Z | girder/molecules/molecules/utilities/pagination.py | bnmajor/mongochemserver | aa76ab6e7f749c3e893f27e208984b6ed2d4b2b5 | [
"BSD-3-Clause"
] | 8 | 2015-06-12T20:54:39.000Z | 2021-04-09T01:07:15.000Z | from girder.constants import SortDir
def default_pagination_params(limit=None, offset=None, sort=None):
"""Returns default params unless they are set"""
if limit is None:
limit = 25
if offset is None:
offset = 0
if sort is None:
sort = [('_id', SortDir.DESCENDING)]
return l... | 28.225 | 67 | 0.612046 | from girder.constants import SortDir
def default_pagination_params(limit=None, offset=None, sort=None):
if limit is None:
limit = 25
if offset is None:
offset = 0
if sort is None:
sort = [('_id', SortDir.DESCENDING)]
return limit, offset, sort
def parse_pagination_params(param... | true | true |
1c331ddd38ebe454abfa15a1da7a1654eb669ea7 | 753 | py | Python | Chapter 6/glossary.py | WilliamJaber/Python-Crash-Course | d87621785011039fbe0b42f0d8b6cd2364246577 | [
"MIT"
] | null | null | null | Chapter 6/glossary.py | WilliamJaber/Python-Crash-Course | d87621785011039fbe0b42f0d8b6cd2364246577 | [
"MIT"
] | null | null | null | Chapter 6/glossary.py | WilliamJaber/Python-Crash-Course | d87621785011039fbe0b42f0d8b6cd2364246577 | [
"MIT"
] | 5 | 2021-09-22T16:53:47.000Z | 2022-03-24T00:56:49.000Z | glossary = {
'integer': 'is colloquially defined as a number that can be written without a fractional component.\n',
'iterate': 'is the repetition of a process in order to generate a sequence of outcomes.\n',
'indentation': 'is an empty space at the beginning of a line that groups particular blocks of code.... | 53.785714 | 107 | 0.707835 | glossary = {
'integer': 'is colloquially defined as a number that can be written without a fractional component.\n',
'iterate': 'is the repetition of a process in order to generate a sequence of outcomes.\n',
'indentation': 'is an empty space at the beginning of a line that groups particular blocks of code.... | true | true |
1c331edf3f31abdaae2975dbc1c63f484ebad872 | 1,409 | py | Python | generate_tsv.py | mr-martian/PTNK | beb162053af8f73dd276d72205eab4ff28591c64 | [
"MIT"
] | null | null | null | generate_tsv.py | mr-martian/PTNK | beb162053af8f73dd276d72205eab4ff28591c64 | [
"MIT"
] | null | null | null | generate_tsv.py | mr-martian/PTNK | beb162053af8f73dd276d72205eab4ff28591c64 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import yaml
def extract_lang(blob, lang):
if lang not in blob:
return []
ret = []
dct = {}
n = 0
for k in blob[lang]:
n1, n2 = blob[lang][k].split('-')
n = max(n, int(n2))
for i in range(int(n1), int(n2)+1):
dct[i] = k
for i in... | 27.627451 | 73 | 0.568488 |
import yaml
def extract_lang(blob, lang):
if lang not in blob:
return []
ret = []
dct = {}
n = 0
for k in blob[lang]:
n1, n2 = blob[lang][k].split('-')
n = max(n, int(n2))
for i in range(int(n1), int(n2)+1):
dct[i] = k
for i in range(1, n+1):
... | true | true |
1c331efec726708105560f1ead5a3cb0947f2d57 | 2,841 | py | Python | xenon_worker/commands/module.py | NicCardozo/xenon-worker | 90915e9738234db28a7a2dea63dd1f5fa7a5ecea | [
"MIT"
] | 17 | 2020-05-07T14:51:14.000Z | 2022-03-21T16:37:10.000Z | xenon_worker/commands/module.py | NicCardozo/xenon-worker | 90915e9738234db28a7a2dea63dd1f5fa7a5ecea | [
"MIT"
] | 5 | 2020-10-16T13:54:54.000Z | 2020-12-21T15:13:31.000Z | xenon_worker/commands/module.py | NicCardozo/xenon-worker | 90915e9738234db28a7a2dea63dd1f5fa7a5ecea | [
"MIT"
] | 7 | 2020-05-15T14:19:20.000Z | 2021-10-14T03:43:34.000Z | from .command import Command
from datetime import timedelta, datetime
import traceback
import asyncio
class Task:
def __init__(self, callback, delta=True, **units):
self.delta = delta
self.callback = callback
self.units = units
self.module = None # Gets filled by bot.add_module
... | 25.366071 | 65 | 0.560366 | from .command import Command
from datetime import timedelta, datetime
import traceback
import asyncio
class Task:
def __init__(self, callback, delta=True, **units):
self.delta = delta
self.callback = callback
self.units = units
self.module = None
@property
def time_to_wai... | true | true |
1c331f3d5b497a66325b056d47f208d9d3525d44 | 4,804 | py | Python | DataStructures/DoubleLinkedList.py | jamwine/Data-Structures-and-Algorithm | 9e1377701d7ea60557130e08fca59b1f9ee2ddab | [
"MIT"
] | null | null | null | DataStructures/DoubleLinkedList.py | jamwine/Data-Structures-and-Algorithm | 9e1377701d7ea60557130e08fca59b1f9ee2ddab | [
"MIT"
] | null | null | null | DataStructures/DoubleLinkedList.py | jamwine/Data-Structures-and-Algorithm | 9e1377701d7ea60557130e08fca59b1f9ee2ddab | [
"MIT"
] | 1 | 2020-06-19T19:54:26.000Z | 2020-06-19T19:54:26.000Z | class DoublyLinkedListNode:
def __init__(self,value):
self.info=value
self.prev=None
self.next=None
class DoubleLinkedList:
def __init__(self):
self.start=None
def display_list(self):
if self.start is None:
print("List is empty.")
... | 25.827957 | 80 | 0.466694 | class DoublyLinkedListNode:
def __init__(self,value):
self.info=value
self.prev=None
self.next=None
class DoubleLinkedList:
def __init__(self):
self.start=None
def display_list(self):
if self.start is None:
print("List is empty.")
... | true | true |
1c3320d62c581e4c4d90edc647893f6ef53ad9c8 | 1,416 | py | Python | src/Loss.py | roshan19041/Causal-Discovery | 900cfc94d9fc3ff3d75366b00bda3acd044ed638 | [
"MIT"
] | 1 | 2020-07-20T00:00:31.000Z | 2020-07-20T00:00:31.000Z | src/Loss.py | roshan19041/Causal-Discovery | 900cfc94d9fc3ff3d75366b00bda3acd044ed638 | [
"MIT"
] | null | null | null | src/Loss.py | roshan19041/Causal-Discovery | 900cfc94d9fc3ff3d75366b00bda3acd044ed638 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 23 18:59:20 2019
@author: roshanprakash
"""
import tensorflow as tf
def compute_loss(generated_data, observed_data):
"""
Computes the Maximum Mean Discrepancy between generated data and observational data.
PARAMETERS
----------... | 38.27027 | 103 | 0.653249 | import tensorflow as tf
def compute_loss(generated_data, observed_data):
N = tf.cast(tf.shape(observed_data)[0], dtype=tf.float32)
GAMMA = tf.constant(0.01, dtype=tf.float32, name='gamma')
MULTIPLIERS = tf.concat([tf.ones([N, 1])/N, tf.ones([N, 1])/-N], axis=0)
X = tf.concat(values=[generated_data, obs... | true | true |
1c33219ed2e9b4b02b73a62e759b3bb6b3f1a3e0 | 5,242 | py | Python | api/admin/controller/discovery_service_library_registrations.py | aseefahmed/circulation | 17cbc9186ab3cde9606912559f92b393ac18ecaa | [
"Apache-2.0"
] | null | null | null | api/admin/controller/discovery_service_library_registrations.py | aseefahmed/circulation | 17cbc9186ab3cde9606912559f92b393ac18ecaa | [
"Apache-2.0"
] | 44 | 2022-01-20T01:31:32.000Z | 2022-03-31T01:50:41.000Z | api/admin/controller/discovery_service_library_registrations.py | jonathangreen/circulation | 118866f8257e2a97431a28ea5ba8e34e5bd393eb | [
"Apache-2.0"
] | null | null | null | import json
import flask
from flask import Response
from flask_babel import lazy_gettext as _
from api.admin.problem_details import *
from api.registration.registry import Registration, RemoteRegistry
from core.model import ExternalIntegration, Library, get_one
from core.util.http import HTTP
from core.util.problem_d... | 37.71223 | 97 | 0.660816 | import json
import flask
from flask import Response
from flask_babel import lazy_gettext as _
from api.admin.problem_details import *
from api.registration.registry import Registration, RemoteRegistry
from core.model import ExternalIntegration, Library, get_one
from core.util.http import HTTP
from core.util.problem_d... | true | true |
1c3321ab02b21c65c4f5b04f4c9668d8d0636669 | 1,063 | py | Python | tf1x/schematic_utils/toy/util.py | dpaiton/DeepSparseCoding | 5ea01fa8770794df5e13743aa3f2d85297c27eb1 | [
"MIT"
] | 12 | 2017-04-27T17:19:31.000Z | 2021-11-07T03:37:59.000Z | tf1x/schematic_utils/toy/util.py | dpaiton/DeepSparseCoding | 5ea01fa8770794df5e13743aa3f2d85297c27eb1 | [
"MIT"
] | 12 | 2018-03-21T01:16:25.000Z | 2022-02-10T00:21:58.000Z | tf1x/schematic_utils/toy/util.py | dpaiton/DeepSparseCoding | 5ea01fa8770794df5e13743aa3f2d85297c27eb1 | [
"MIT"
] | 12 | 2017-02-01T19:49:57.000Z | 2021-12-08T03:16:58.000Z | from itertools import product
import autograd
import autograd.numpy as np
def orthogonalize(twovector):
return np.asarray([-twovector[1], twovector[0]])
def follow_grad(starting_point, f, lims=[0, 1], eps=1e-2):
grad = autograd.grad(f)
points = [starting_point]
point = points[-1]
while (max(po... | 24.159091 | 66 | 0.66604 | from itertools import product
import autograd
import autograd.numpy as np
def orthogonalize(twovector):
return np.asarray([-twovector[1], twovector[0]])
def follow_grad(starting_point, f, lims=[0, 1], eps=1e-2):
grad = autograd.grad(f)
points = [starting_point]
point = points[-1]
while (max(po... | true | true |
1c3321d53937d70c3138dce8331d00032cd770e2 | 569 | py | Python | ex4.py | Tobijoe/LPTHW | 12f3e412c339f51828c909a94fd55ef6e7eb8b5b | [
"MIT"
] | null | null | null | ex4.py | Tobijoe/LPTHW | 12f3e412c339f51828c909a94fd55ef6e7eb8b5b | [
"MIT"
] | null | null | null | ex4.py | Tobijoe/LPTHW | 12f3e412c339f51828c909a94fd55ef6e7eb8b5b | [
"MIT"
] | null | null | null | cars = 100
space_in_a_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven
print ("There are", cars, "cars available.")
print ("There are only", drivers, "drivers available.")... | 37.933333 | 73 | 0.752197 | cars = 100
space_in_a_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_a_car
average_passengers_per_car = passengers / cars_driven
print ("There are", cars, "cars available.")
print ("There are only", drivers, "drivers available.")... | true | true |
1c3321f2fce232ea67552cbefce40cb955c25c68 | 5,869 | py | Python | conclave/__init__.py | byzhang/conclave | ddc6a39df2c577d1f3cd2c969d67a7760f4b596f | [
"MIT"
] | 69 | 2018-02-28T13:25:24.000Z | 2022-03-17T00:51:43.000Z | conclave/__init__.py | byzhang/conclave | ddc6a39df2c577d1f3cd2c969d67a7760f4b596f | [
"MIT"
] | 5 | 2018-01-29T16:57:19.000Z | 2020-06-15T15:06:57.000Z | conclave/__init__.py | byzhang/conclave | ddc6a39df2c577d1f3cd2c969d67a7760f4b596f | [
"MIT"
] | 25 | 2018-01-23T22:09:11.000Z | 2022-01-16T11:26:44.000Z | import conclave.comp as comp
import conclave.dag as condag
import conclave.partition as part
from conclave.codegen import scotch
from conclave.codegen.python import PythonCodeGen
from conclave.codegen.sharemind import SharemindCodeGen
from conclave.codegen.spark import SparkCodeGen
from conclave.codegen.oblivc import O... | 41.041958 | 114 | 0.671324 | import conclave.comp as comp
import conclave.dag as condag
import conclave.partition as part
from conclave.codegen import scotch
from conclave.codegen.python import PythonCodeGen
from conclave.codegen.sharemind import SharemindCodeGen
from conclave.codegen.spark import SparkCodeGen
from conclave.codegen.oblivc import O... | true | true |
1c332227a6194c8234094026d9cfbccdd8d11330 | 570 | py | Python | benchmark/test_ope.py | MartinHeinz/IoT-Cloud | 2e6fddcfe2624862c9351759334a6655a896e8c7 | [
"MIT"
] | 14 | 2019-11-17T23:49:20.000Z | 2022-02-04T23:28:45.000Z | benchmark/test_ope.py | MartinHeinz/IoT-Cloud | 2e6fddcfe2624862c9351759334a6655a896e8c7 | [
"MIT"
] | 3 | 2019-12-02T18:26:11.000Z | 2021-04-30T20:46:06.000Z | benchmark/test_ope.py | MartinHeinz/IoT-Cloud | 2e6fddcfe2624862c9351759334a6655a896e8c7 | [
"MIT"
] | 4 | 2018-12-28T13:41:44.000Z | 2020-09-13T14:14:06.000Z | from random import randint
import pytest
from pyope.ope import OPE
from client.crypto_utils import instantiate_ope_cipher
@pytest.fixture(scope="module", autouse=True)
def cipher():
random_key = OPE.generate_key()
c = instantiate_ope_cipher(random_key)
return c
def test_ope_encrypt(benchmark, cipher):... | 25.909091 | 110 | 0.764912 | from random import randint
import pytest
from pyope.ope import OPE
from client.crypto_utils import instantiate_ope_cipher
@pytest.fixture(scope="module", autouse=True)
def cipher():
random_key = OPE.generate_key()
c = instantiate_ope_cipher(random_key)
return c
def test_ope_encrypt(benchmark, cipher):... | true | true |
1c3322701550af76c8751e686cfd254af5a7c22f | 34,040 | py | Python | packages/fetchai/protocols/tac/message.py | devjsc/agents-aea | 872f7b76cbcd33b6c809905c68681790bb93ff2f | [
"Apache-2.0"
] | null | null | null | packages/fetchai/protocols/tac/message.py | devjsc/agents-aea | 872f7b76cbcd33b6c809905c68681790bb93ff2f | [
"Apache-2.0"
] | null | null | null | packages/fetchai/protocols/tac/message.py | devjsc/agents-aea | 872f7b76cbcd33b6c809905c68681790bb93ff2f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021 fetchai
#
# 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
#
#... | 44.150454 | 143 | 0.503613 |
import logging
from typing import Any, Dict, Optional, Set, Tuple, cast
from aea.configurations.base import PublicId
from aea.exceptions import AEAEnforceError, enforce
from aea.protocols.base import Message
from packages.fetchai.protocols.tac.custom_types import ErrorCode as CustomErrorCode
_default_logger = log... | true | true |
1c3323146779e0cbb445f721075cc2454146f5ce | 13,377 | py | Python | sdk/python/pulumi_azure_native/datashare/synapse_workspace_sql_pool_table_data_set.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datashare/synapse_workspace_sql_pool_table_data_set.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datashare/synapse_workspace_sql_pool_table_data_set.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
from... | 46.936842 | 1,089 | 0.676684 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
__all__ = ['SynapseWorkspaceSqlPoolTableDataSetArgs', 'SynapseWorkspaceSqlPoolTableDataSet']
@pulumi.input_type
class SynapseWorkspaceSqlPoolTableDa... | true | true |
1c33247d1ebd76b37c331b06ae4b8b207ceb0b05 | 16,856 | py | Python | dbtmetabase/metabase.py | venturehacks/dbt-metabase | 8fd76c5b2dab180fca24b6742b68f5f668a3e7cb | [
"MIT"
] | null | null | null | dbtmetabase/metabase.py | venturehacks/dbt-metabase | 8fd76c5b2dab180fca24b6742b68f5f668a3e7cb | [
"MIT"
] | null | null | null | dbtmetabase/metabase.py | venturehacks/dbt-metabase | 8fd76c5b2dab180fca24b6742b68f5f668a3e7cb | [
"MIT"
] | null | null | null | import json
import logging
from typing import Any, Sequence, Optional, Tuple, Iterable, MutableMapping, Union
import requests
import time
from .models.metabase import MetabaseModel, MetabaseColumn
class MetabaseClient:
"""Metabase API client."""
_SYNC_PERIOD_SECS = 5
def __init__(
self,
... | 35.116667 | 149 | 0.54669 | import json
import logging
from typing import Any, Sequence, Optional, Tuple, Iterable, MutableMapping, Union
import requests
import time
from .models.metabase import MetabaseModel, MetabaseColumn
class MetabaseClient:
_SYNC_PERIOD_SECS = 5
def __init__(
self,
host: str,
user: str,... | true | true |
1c33255da650a6e219e2d8259c06989b5ad06956 | 2,091 | py | Python | hknweb/urls.py | yousefh409/hknweb | d791e9f009d216a6e61f5a62a71077ff1098d9e7 | [
"MIT"
] | 1 | 2021-11-03T04:42:09.000Z | 2021-11-03T04:42:09.000Z | hknweb/urls.py | yousefh409/hknweb | d791e9f009d216a6e61f5a62a71077ff1098d9e7 | [
"MIT"
] | null | null | null | hknweb/urls.py | yousefh409/hknweb | d791e9f009d216a6e61f5a62a71077ff1098d9e7 | [
"MIT"
] | null | null | null | """hknweb 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: url(r'^$', views.home, name='home')
Class-base... | 41.82 | 80 | 0.702056 | from django.contrib import admin
from django.urls import include
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from .shortlinks import views as viewsShortlink
from .views import landing
from .views import users
urlpatterns = [
path("admin/", admin.site.ur... | true | true |
1c332573b838a8eb88b2d6b5b813b8b4fa3e8fc9 | 342 | py | Python | autotest/tests/login/conftest.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | autotest/tests/login/conftest.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | autotest/tests/login/conftest.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
"""
@version: v1.0
@author: Richard
@license: Apache Licence
@contact: billions.richard@qq.com
@site:https://github.com/BillionsRichard
@software: PyCharm
@time: 2020/11/1 10:53
"""
import pytest
@pytest.fixture(scope="package", autouse=True)
def st_login():
print("初始化---login")
yield
... | 14.869565 | 46 | 0.684211 |
import pytest
@pytest.fixture(scope="package", autouse=True)
def st_login():
print("初始化---login")
yield
print("清除---login")
| true | true |
1c3325c5abfa60aab2337e73ceec6e344c0c323f | 3,960 | py | Python | test/programytest/storage/stores/nosql/redis/store/test_conversations.py | cdoebler1/AIML2 | ee692ec5ea3794cd1bc4cc8ec2a6b5e5c20a0d6a | [
"MIT"
] | 345 | 2016-11-23T22:37:04.000Z | 2022-03-30T20:44:44.000Z | test/programytest/storage/stores/nosql/redis/store/test_conversations.py | MikeyBeez/program-y | 00d7a0c7d50062f18f0ab6f4a041068e119ef7f0 | [
"MIT"
] | 275 | 2016-12-07T10:30:28.000Z | 2022-02-08T21:28:33.000Z | test/programytest/storage/stores/nosql/redis/store/test_conversations.py | VProgramMist/modified-program-y | f32efcafafd773683b3fe30054d5485fe9002b7d | [
"MIT"
] | 159 | 2016-11-28T18:59:30.000Z | 2022-03-20T18:02:44.000Z | import unittest
import programytest.storage.engines as Engines
from programy.dialog.conversation import Conversation
from programy.dialog.question import Question
from programy.storage.stores.nosql.redis.config import RedisStorageConfiguration
from programy.storage.stores.nosql.redis.engine import RedisStorageEngine
f... | 39.6 | 91 | 0.736869 | import unittest
import programytest.storage.engines as Engines
from programy.dialog.conversation import Conversation
from programy.dialog.question import Question
from programy.storage.stores.nosql.redis.config import RedisStorageConfiguration
from programy.storage.stores.nosql.redis.engine import RedisStorageEngine
f... | true | true |
1c3326aed05c037d41918d057a1a93994e862c35 | 1,971 | py | Python | consoleerp_erpnext_client/api/custom_link_queries.py | consoleerp/consoleerp_erpnext_client | 44bc79f45e87c750e739d4cc82a42ecd7b94eb60 | [
"MIT"
] | 3 | 2017-04-02T11:44:01.000Z | 2018-05-04T20:46:19.000Z | consoleerp_erpnext_client/api/custom_link_queries.py | consoleerp/consoleerp_erpnext_client | 44bc79f45e87c750e739d4cc82a42ecd7b94eb60 | [
"MIT"
] | 7 | 2017-03-25T08:31:34.000Z | 2017-05-18T09:48:50.000Z | consoleerp_erpnext_client/api/custom_link_queries.py | consoleerp/consoleerp_erpnext_client | 44bc79f45e87c750e739d4cc82a42ecd7b94eb60 | [
"MIT"
] | 4 | 2017-04-02T11:44:02.000Z | 2019-08-29T17:08:49.000Z | from __future__ import unicode_literals
import frappe
from frappe.desk.reportview import get_match_cond
from frappe.model.db_query import DatabaseQuery
from frappe.utils import nowdate
def customer_query(doctype, txt, searchfield, start, page_len, filters):
conditions = []
cust_master_name = frappe.defaults.get_use... | 29.41791 | 79 | 0.666667 | from __future__ import unicode_literals
import frappe
from frappe.desk.reportview import get_match_cond
from frappe.model.db_query import DatabaseQuery
from frappe.utils import nowdate
def customer_query(doctype, txt, searchfield, start, page_len, filters):
conditions = []
cust_master_name = frappe.defaults.get_use... | true | true |
1c33272368020e92f0b9071c611e84c90714f5f1 | 976 | py | Python | MAQTextSDK/models/data_input_data_item_py3.py | maqsoftware/TextAnalyticsSDK | 545533d79db2f23e395495e9968c121ea3474ae4 | [
"MIT"
] | null | null | null | MAQTextSDK/models/data_input_data_item_py3.py | maqsoftware/TextAnalyticsSDK | 545533d79db2f23e395495e9968c121ea3474ae4 | [
"MIT"
] | null | null | null | MAQTextSDK/models/data_input_data_item_py3.py | maqsoftware/TextAnalyticsSDK | 545533d79db2f23e395495e9968c121ea3474ae4 | [
"MIT"
] | 6 | 2020-11-19T07:09:54.000Z | 2021-12-06T10:40:14.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 27.111111 | 76 | 0.505123 |
from msrest.serialization import Model
class DataInputDataItem(Model):
_validation = {
"id": {"required": True},
"text": {"required": True},
}
_attribute_map = {
"id": {"key": "id", "type": "str"},
"text": {"key": "text", "type": "str"},
}
def __init__(self, *, ... | true | true |
1c3327f3a2fa39f13359dcded445dadbcae279bc | 8,736 | py | Python | detectron/modeling/backbone/ftt_fpn.py | guowenhao787938711/EFPN-detectron2 | 58caabcf5edd5615f17d844618cf42367e567ee3 | [
"Apache-2.0"
] | 1 | 2021-07-16T06:05:56.000Z | 2021-07-16T06:05:56.000Z | detectron2/modeling/backbone/ftt_fpn.py | Kg6815311/pipe_EFPN_detectron2 | 1a381027cc19845afb88461bd5c96fa0fd75f449 | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/backbone/ftt_fpn.py | Kg6815311/pipe_EFPN_detectron2 | 1a381027cc19845afb88461bd5c96fa0fd75f449 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
import math
import fvcore.nn.weight_init as weight_init
import torch.nn.functional as F
from torch import nn
from detectron2.layers import Conv2d, ShapeSpec, get_norm
from .backbone import Backbone
from .build import BACKBONE_REGISTRY
from .resnet import build_resnet... | 39.529412 | 99 | 0.616529 | import math
import fvcore.nn.weight_init as weight_init
import torch.nn.functional as F
from torch import nn
from detectron2.layers import Conv2d, ShapeSpec, get_norm
from .backbone import Backbone
from .build import BACKBONE_REGISTRY
from .resnet import build_resnet_backbone
from .ftt import FTT
__all__ = ["build_... | true | true |
1c332877e8cbf590e4cefbf6c34341c2dc3f327f | 1,281 | py | Python | models/work_concept.py | zbj-labs/openalex-guts | 4e54363591da66b35a7376009ad1bca534559f98 | [
"MIT"
] | null | null | null | models/work_concept.py | zbj-labs/openalex-guts | 4e54363591da66b35a7376009ad1bca534559f98 | [
"MIT"
] | null | null | null | models/work_concept.py | zbj-labs/openalex-guts | 4e54363591da66b35a7376009ad1bca534559f98 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from app import db
# truncate mid.work_concept
# insert into mid.work_concept (select * from legacy.mag_advanced_paper_fields_of_study)
# refresh materialized view mid.work_concept_for_api_mv
class WorkConcept(db.Model):
__table_args__ = {'schema': 'mid'}
__tablen... | 35.583333 | 122 | 0.736144 | from cached_property import cached_property
from app import db
class WorkConcept(db.Model):
__table_args__ = {'schema': 'mid'}
__tablename__ = "work_concept_for_api_mv"
paper_id = db.Column(db.BigInteger, db.ForeignKey("mid.work.paper_id"), primary_key=True)
field_of_study = db.Column(db.BigInteger... | true | true |
1c332a2579cdb6149a4ddf3406958e98917add97 | 174 | py | Python | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_ConstantTrend_Seasonal_MonthOfYear_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_ConstantTrend_Seasonal_MonthOfYear_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_ConstantTrend_Seasonal_MonthOfYear_SVR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['ConstantTrend'] , ['Seasonal_MonthOfYear'] , ['SVR'] ); | 43.5 | 96 | 0.770115 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['ConstantTrend'] , ['Seasonal_MonthOfYear'] , ['SVR'] ); | true | true |
1c332adf25a96537958b311ef5dcb734e23f444c | 1,047 | py | Python | seq2seq/metrics/test.py | gyy8426/TF_concaption | 7b3face47c96c885b2715605122328b7b6bef609 | [
"Apache-2.0"
] | null | null | null | seq2seq/metrics/test.py | gyy8426/TF_concaption | 7b3face47c96c885b2715605122328b7b6bef609 | [
"Apache-2.0"
] | null | null | null | seq2seq/metrics/test.py | gyy8426/TF_concaption | 7b3face47c96c885b2715605122328b7b6bef609 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from tensorflow.contrib import metrics
from tensorflow.contrib.learn import MetricSpec
def accumulate_strings(values, name="strings"):
"""Accumulates strings into a vector.
Args:
values: A 1-d string tensor that contains values to add to the accumulator.
Returns:
A tu... | 27.552632 | 80 | 0.674308 | import tensorflow as tf
from tensorflow.contrib import metrics
from tensorflow.contrib.learn import MetricSpec
def accumulate_strings(values, name="strings"):
tf.assert_type(values, tf.string)
strings = tf.Variable(
name=name,
initial_value=[],
dtype=tf.string,
trainable=False,
... | true | true |
1c332b281ac35c1405ffb25ee199f2a15ddae1dc | 1,261 | py | Python | python/lib/dcoscli/tests/integrations/test_auth.py | bamarni/dcos-core-cli | a550652477175f48708a361fd0d65e21d243cded | [
"Apache-2.0",
"MIT"
] | null | null | null | python/lib/dcoscli/tests/integrations/test_auth.py | bamarni/dcos-core-cli | a550652477175f48708a361fd0d65e21d243cded | [
"Apache-2.0",
"MIT"
] | null | null | null | python/lib/dcoscli/tests/integrations/test_auth.py | bamarni/dcos-core-cli | a550652477175f48708a361fd0d65e21d243cded | [
"Apache-2.0",
"MIT"
] | null | null | null | import os
import pytest
from dcos import constants
from dcoscli.test.common import assert_command, exec_command, update_config
@pytest.fixture
def env():
r = os.environ.copy()
r.update({constants.PATH_ENV: os.environ[constants.PATH_ENV]})
return r
def test_info():
stdout = b'Authenticate to DC/O... | 26.270833 | 75 | 0.620936 | import os
import pytest
from dcos import constants
from dcoscli.test.common import assert_command, exec_command, update_config
@pytest.fixture
def env():
r = os.environ.copy()
r.update({constants.PATH_ENV: os.environ[constants.PATH_ENV]})
return r
def test_info():
stdout = b'Authenticate to DC/O... | true | true |
1c332b4a13f5fefc7873b7b77a62dad93a489440 | 2,703 | py | Python | apps/sumo/monkeypatch.py | taliasman/kitsune | f8085205eef143011adb4c52d1f183da06c1c58e | [
"BSD-3-Clause"
] | 2 | 2019-08-19T17:08:47.000Z | 2019-10-05T11:37:02.000Z | apps/sumo/monkeypatch.py | taliasman/kitsune | f8085205eef143011adb4c52d1f183da06c1c58e | [
"BSD-3-Clause"
] | null | null | null | apps/sumo/monkeypatch.py | taliasman/kitsune | f8085205eef143011adb4c52d1f183da06c1c58e | [
"BSD-3-Clause"
] | null | null | null | from django.forms import fields
from django.forms import widgets
# Monkey patch preserves the old values, so we can pick up any changes
# in CharField.widget_attrs and Field.widget_attrs
# paulc filed a Django ticket for it, #14884
field_widget_attrs = fields.Field.widget_attrs
charfield_widget_attrs = fields.CharFiel... | 31.8 | 79 | 0.740659 | from django.forms import fields
from django.forms import widgets
field_widget_attrs = fields.Field.widget_attrs
charfield_widget_attrs = fields.CharField.widget_attrs
def required_field_attrs(self, widget):
attrs = field_widget_attrs(self, widget)
if (self.required and (not 'required' in attrs) and
... | true | true |
1c332bb22561fec9d19d2aa8adf27d639e17a682 | 2,277 | py | Python | tests/test_structures.py | davidfischer/requests | 7a404cf4ec5aac04d72dc507a981fee944b18cd8 | [
"Apache-2.0"
] | 10 | 2016-08-03T05:10:16.000Z | 2018-04-10T19:36:35.000Z | tests/test_structures.py | davidfischer/requests | 7a404cf4ec5aac04d72dc507a981fee944b18cd8 | [
"Apache-2.0"
] | 25 | 2016-08-24T00:19:19.000Z | 2021-04-17T14:20:24.000Z | tests/test_structures.py | davidfischer/requests | 7a404cf4ec5aac04d72dc507a981fee944b18cd8 | [
"Apache-2.0"
] | 2 | 2019-06-17T11:51:56.000Z | 2020-07-25T08:29:56.000Z | # coding: utf-8
import pytest
from requests.structures import CaseInsensitiveDict, LookupDict
class TestCaseInsensitiveDict:
@pytest.fixture(autouse=True)
def setup(self):
"""
CaseInsensitiveDict instance with "Accept" header.
"""
self.case_insensitive_dict = CaseInsensitiveD... | 28.4625 | 97 | 0.63856 | import pytest
from requests.structures import CaseInsensitiveDict, LookupDict
class TestCaseInsensitiveDict:
@pytest.fixture(autouse=True)
def setup(self):
self.case_insensitive_dict = CaseInsensitiveDict()
self.case_insensitive_dict['Accept'] = 'application/json'
def test_list(self):
... | true | true |
1c332bd5f1d5fd836763369f4e2ded2d5830f275 | 7,504 | py | Python | CSM_Cleanup.py | LGTOman/CSM_Cleanup | a28445c98213a39735c929825aff7a1a966f05b6 | [
"MIT"
] | null | null | null | CSM_Cleanup.py | LGTOman/CSM_Cleanup | a28445c98213a39735c929825aff7a1a966f05b6 | [
"MIT"
] | null | null | null | CSM_Cleanup.py | LGTOman/CSM_Cleanup | a28445c98213a39735c929825aff7a1a966f05b6 | [
"MIT"
] | null | null | null | import sys
import boto3
from botocore.exceptions import ClientError, EndpointConnectionError
from datetime import datetime, timedelta, timezone
import argparse
import pprint
product = "Dell EMC Cloud Snapshot Manager (aka Amazonite)"
defaultdays = 60
dryrun = False
regions = []
parser = argparse.ArgumentParser(descr... | 34.902326 | 141 | 0.604211 | import sys
import boto3
from botocore.exceptions import ClientError, EndpointConnectionError
from datetime import datetime, timedelta, timezone
import argparse
import pprint
product = "Dell EMC Cloud Snapshot Manager (aka Amazonite)"
defaultdays = 60
dryrun = False
regions = []
parser = argparse.ArgumentParser(descr... | true | true |
1c332bf5fc4caea777c8a2827663952f8a4ac75d | 3,438 | py | Python | network/sdn/l2_pairs.py | sabertazimi/hust-lab | dc3425b6afe75ac3c1b48bb62fdd27c425284a0f | [
"MIT"
] | 29 | 2017-07-30T07:46:11.000Z | 2021-11-21T15:51:04.000Z | network/sdn/l2_pairs.py | sabertazimi/hust-lab | dc3425b6afe75ac3c1b48bb62fdd27c425284a0f | [
"MIT"
] | 2 | 2018-03-22T10:09:35.000Z | 2021-09-12T16:08:35.000Z | network/sdn/l2_pairs.py | sabertazimi/hust-lab | dc3425b6afe75ac3c1b48bb62fdd27c425284a0f | [
"MIT"
] | 9 | 2018-09-03T13:14:08.000Z | 2021-06-25T17:00:46.000Z | # Copyright 2012 James McCauley
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 34.38 | 152 | 0.717859 |
from pox.core import core
import pox.openflow.libopenflow_01 as of
from pox.lib.util import dpid_to_str, str_to_dpid
log = core.getLogger()
table = {}
# but it's not clear if all switches support this, so we make
all_ports = of.OFPP_FLOOD
def _handle_PacketIn (event):
packet = event.parsed
table[(even... | true | true |
1c332c87eea00365557e19e91322e96fdb2d1137 | 3,378 | py | Python | day_24/part_1/main.py | MoeFourtyTwo/advent-of-code | 123a716a26add390913eb268a59ef68b45666ef4 | [
"MIT"
] | null | null | null | day_24/part_1/main.py | MoeFourtyTwo/advent-of-code | 123a716a26add390913eb268a59ef68b45666ef4 | [
"MIT"
] | null | null | null | day_24/part_1/main.py | MoeFourtyTwo/advent-of-code | 123a716a26add390913eb268a59ef68b45666ef4 | [
"MIT"
] | null | null | null | from __future__ import annotations
import timeit
import fire
import pandas as pd
from tqdm import tqdm
def main(input_file: str = "input.txt", search_max: bool = True) -> None:
instructions = parse_instructions(input_file)
alus = pd.DataFrame(
{
"w": [0],
"x": 0,
... | 35.1875 | 94 | 0.530491 | from __future__ import annotations
import timeit
import fire
import pandas as pd
from tqdm import tqdm
def main(input_file: str = "input.txt", search_max: bool = True) -> None:
instructions = parse_instructions(input_file)
alus = pd.DataFrame(
{
"w": [0],
"x": 0,
... | true | true |
1c332c9df7e7b1bcd442640eb38fe7704e22ec65 | 10,076 | py | Python | classifier/train.py | shivammehta007/NLPinEnglishLearning | ae869d868e39df9b1787134ba6e964acd385dd2e | [
"Apache-2.0"
] | 1 | 2020-05-27T22:21:33.000Z | 2020-05-27T22:21:33.000Z | classifier/train.py | shivammehta007/NLPinEnglishLearning | ae869d868e39df9b1787134ba6e964acd385dd2e | [
"Apache-2.0"
] | null | null | null | classifier/train.py | shivammehta007/NLPinEnglishLearning | ae869d868e39df9b1787134ba6e964acd385dd2e | [
"Apache-2.0"
] | null | null | null | """
Training script for the model
"""
import argparse
import logging
import os
import time
import torch
import torch.nn as nn
import torch.optim as optim
from tqdm.auto import tqdm
from config.hyperparameters import (
BATCH_SIZE,
BIDIRECTION,
DROPOUT,
EMBEDDING_DIM,
EPOCHS,
FREEZE_EMBEDDINGS,
... | 26.308094 | 98 | 0.599047 | import argparse
import logging
import os
import time
import torch
import torch.nn as nn
import torch.optim as optim
from tqdm.auto import tqdm
from config.hyperparameters import (
BATCH_SIZE,
BIDIRECTION,
DROPOUT,
EMBEDDING_DIM,
EPOCHS,
FREEZE_EMBEDDINGS,
HIDDEN_DIM,
LR,
N_LAYERS,
... | true | true |
1c332df2de45291065787fb30c0fb88048124ea9 | 1,161 | py | Python | ros2trace/setup.py | hliberacki/ros2_tracing | c0a3512137382bd97c5a013526d3d4f59f58c165 | [
"Apache-2.0"
] | null | null | null | ros2trace/setup.py | hliberacki/ros2_tracing | c0a3512137382bd97c5a013526d3d4f59f58c165 | [
"Apache-2.0"
] | null | null | null | ros2trace/setup.py | hliberacki/ros2_tracing | c0a3512137382bd97c5a013526d3d4f59f58c165 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages
from setuptools import setup
package_name = 'ros2trace'
setup(
name=package_name,
version='4.0.0',
packages=find_packages(exclude=['test']),
data_files=[
('share/' + package_name, ['package.xml']),
('share/ament_index/resource_index/packages',
... | 27.642857 | 68 | 0.625323 | from setuptools import find_packages
from setuptools import setup
package_name = 'ros2trace'
setup(
name=package_name,
version='4.0.0',
packages=find_packages(exclude=['test']),
data_files=[
('share/' + package_name, ['package.xml']),
('share/ament_index/resource_index/packages',
... | true | true |
1c332e26d923bffec6844f1832e10218c0d0b55e | 4,277 | py | Python | preprocessor/preprocessor.py | thepowerfuldeez/VAENAR-TTS | 7ee40a5511118491269102bc6874a51c1d9959ee | [
"MIT"
] | null | null | null | preprocessor/preprocessor.py | thepowerfuldeez/VAENAR-TTS | 7ee40a5511118491269102bc6874a51c1d9959ee | [
"MIT"
] | null | null | null | preprocessor/preprocessor.py | thepowerfuldeez/VAENAR-TTS | 7ee40a5511118491269102bc6874a51c1d9959ee | [
"MIT"
] | null | null | null | import os
import random
import json
import tgt
import librosa
import numpy as np
from tqdm import tqdm
import audio as Audio
from text import grapheme_to_phoneme
from utils.tools import read_lexicon
from g2p_en import G2p
random.seed(1234)
class Preprocessor:
def __init__(self, config):
self.config = c... | 33.677165 | 128 | 0.574468 | import os
import random
import json
import tgt
import librosa
import numpy as np
from tqdm import tqdm
import audio as Audio
from text import grapheme_to_phoneme
from utils.tools import read_lexicon
from g2p_en import G2p
random.seed(1234)
class Preprocessor:
def __init__(self, config):
self.config = c... | true | true |
1c332e30c32aa1ed1f57437c220782a600b636df | 3,771 | py | Python | tests/plugins/base_test.py | digjanaik/detect-secrets | 624024ad5fd8a608e09ed719e5edab6ca95ef47e | [
"Apache-2.0"
] | 1 | 2020-05-19T05:07:19.000Z | 2020-05-19T05:07:19.000Z | tests/plugins/base_test.py | digjanaik/detect-secrets | 624024ad5fd8a608e09ed719e5edab6ca95ef47e | [
"Apache-2.0"
] | 1 | 2020-08-12T21:57:16.000Z | 2020-08-12T21:57:16.000Z | tests/plugins/base_test.py | digjanaik/detect-secrets | 624024ad5fd8a608e09ed719e5edab6ca95ef47e | [
"Apache-2.0"
] | 1 | 2021-07-14T16:53:12.000Z | 2021-07-14T16:53:12.000Z | from contextlib import contextmanager
import mock
import pytest
from detect_secrets.core.constants import VerifiedResult
from detect_secrets.plugins.base import BasePlugin
from testing.factories import potential_secret_factory
from testing.mocks import mock_file_object
@pytest.mark.parametrize(
'name, expected'... | 31.425 | 78 | 0.619464 | from contextlib import contextmanager
import mock
import pytest
from detect_secrets.core.constants import VerifiedResult
from detect_secrets.plugins.base import BasePlugin
from testing.factories import potential_secret_factory
from testing.mocks import mock_file_object
@pytest.mark.parametrize(
'name, expected'... | true | true |
1c332eadaeec91974c0a1e42791d552c367427f6 | 1,259 | py | Python | profiles/migrations/0002_auto_20210313_1656.py | ezekieltech/eduTech-backend | 33b82f57add98285b73d89bc9d97f499cdb3f1e4 | [
"MIT"
] | null | null | null | profiles/migrations/0002_auto_20210313_1656.py | ezekieltech/eduTech-backend | 33b82f57add98285b73d89bc9d97f499cdb3f1e4 | [
"MIT"
] | 15 | 2021-01-02T17:43:37.000Z | 2021-02-13T12:02:11.000Z | profiles/migrations/0002_auto_20210313_1656.py | ezekieltech/eduTech-backend | 33b82f57add98285b73d89bc9d97f499cdb3f1e4 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-03-13 15:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('profiles', '0001_initial'),
migrations.swappable_dependency(set... | 37.029412 | 196 | 0.67355 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('profiles', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = ... | true | true |
1c332eba54cf48ce209e84efa7ccdceb379fb0bc | 492 | py | Python | tests/nn/mse_loss_test.py | kbrodt/tor4 | d09740b746c534e67a72f492c7c03654f5888a46 | [
"MIT"
] | null | null | null | tests/nn/mse_loss_test.py | kbrodt/tor4 | d09740b746c534e67a72f492c7c03654f5888a46 | [
"MIT"
] | null | null | null | tests/nn/mse_loss_test.py | kbrodt/tor4 | d09740b746c534e67a72f492c7c03654f5888a46 | [
"MIT"
] | null | null | null | import tor4
import tor4.nn as nn
def test_mse_backward():
inputs = tor4.tensor(data=[1.0, 2, 3], requires_grad=True)
targets = tor4.tensor(data=[2, 3, 2])
mse_nn = nn.functional.mse_loss(inputs, targets)
mse = ((inputs - targets) ** 2).mean()
mse2 = nn.functional.mse_loss_slow(inputs, targets)
... | 27.333333 | 62 | 0.634146 | import tor4
import tor4.nn as nn
def test_mse_backward():
inputs = tor4.tensor(data=[1.0, 2, 3], requires_grad=True)
targets = tor4.tensor(data=[2, 3, 2])
mse_nn = nn.functional.mse_loss(inputs, targets)
mse = ((inputs - targets) ** 2).mean()
mse2 = nn.functional.mse_loss_slow(inputs, targets)
... | true | true |
1c332f66e37a34e84130c88451c698f9e98f4daa | 1,640 | py | Python | textParser.py | guardian/google-ad-database-processing-scripts | e5e6becabb2f9696f2979936234cdb878626f557 | [
"MIT"
] | 1 | 2021-12-04T00:03:35.000Z | 2021-12-04T00:03:35.000Z | textParser.py | guardian/google-ad-database-processing-scripts | e5e6becabb2f9696f2979936234cdb878626f557 | [
"MIT"
] | null | null | null | textParser.py | guardian/google-ad-database-processing-scripts | e5e6becabb2f9696f2979936234cdb878626f557 | [
"MIT"
] | null | null | null | import requests
import simplejson as json
import scraperwiki
import time
# Text ad example https://transparencyreport.google.com/transparencyreport/api/v3/politicalads/creatives/details?entity_id=AR117485875444580352&creative_id=CR113556358325862400&hl=en
def getFullAdText(ad_text_json):
full_text = ""
for thing in... | 32.8 | 182 | 0.739634 | import requests
import simplejson as json
import scraperwiki
import time
def getFullAdText(ad_text_json):
full_text = ""
for thing in ad_text_json:
if type(thing) is str:
full_text = full_text + thing + "\n"
elif type(thing) is list:
for things in thing:
full_text = full_text + things + " "
full_t... | true | true |
1c333086cd645f5e0478b97ef3ea91b87966bce8 | 12,641 | py | Python | vumi/transports/cellulant/tests/test_cellulant_sms.py | vishwaprakashmishra/xmatrix | aefdab7e2980748746c7fefcd75c965cea55466f | [
"BSD-3-Clause"
] | 1 | 2016-07-27T17:13:32.000Z | 2016-07-27T17:13:32.000Z | vumi/transports/cellulant/tests/test_cellulant_sms.py | TouK/vumi | 6d250c7039fa1d82b01c5b68722aa8a6a94580b2 | [
"BSD-3-Clause"
] | null | null | null | vumi/transports/cellulant/tests/test_cellulant_sms.py | TouK/vumi | 6d250c7039fa1d82b01c5b68722aa8a6a94580b2 | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
import json
from urllib import urlencode
from twisted.internet.defer import inlineCallbacks, DeferredQueue, returnValue
from vumi.utils import http_request, http_request_full
from vumi.tests.utils import MockHttpServer
from vumi.tests.helpers import VumiTestCase
from vumi.transports.cellula... | 37.622024 | 78 | 0.592596 |
import json
from urllib import urlencode
from twisted.internet.defer import inlineCallbacks, DeferredQueue, returnValue
from vumi.utils import http_request, http_request_full
from vumi.tests.utils import MockHttpServer
from vumi.tests.helpers import VumiTestCase
from vumi.transports.cellulant import CellulantSmsTran... | true | true |
1c3330f58e7b519be076c0bf3286fea33c99ab94 | 2,907 | py | Python | scripts/helperSimulations.py | alok123t/HyINDEL | 39cb5a32f08c9c3054f9b7237cb39baab7172d82 | [
"MIT"
] | 4 | 2020-07-11T09:49:09.000Z | 2021-10-14T18:54:53.000Z | scripts/helperSimulations.py | alok123t/HyINDEL | 39cb5a32f08c9c3054f9b7237cb39baab7172d82 | [
"MIT"
] | 1 | 2021-10-10T14:21:06.000Z | 2021-11-06T13:01:18.000Z | scripts/helperSimulations.py | alok123t/HyINDEL | 39cb5a32f08c9c3054f9b7237cb39baab7172d82 | [
"MIT"
] | null | null | null | import random
import sys
# Small, large size ranges
DISTR = [[50, 500], [500, 10000]]
# Number of variants for each size range
N_DISTR = 375
def getRandomString(l):
return ''.join(random.choice('ATGC') for _ in range(l))
def genPositions():
# For each size range
for d in DISTR:
# Insertions
... | 28.782178 | 86 | 0.43894 | import random
import sys
DISTR = [[50, 500], [500, 10000]]
N_DISTR = 375
def getRandomString(l):
return ''.join(random.choice('ATGC') for _ in range(l))
def genPositions():
for d in DISTR:
rndVals = random.sample(range(d[0], d[1]), N_DISTR)
for val in rndVals:
out = ... | true | true |
1c3331f13df114ad08467370a9d4d07f01f65559 | 7,816 | py | Python | examples/pwr_run/checkpointing/final/no_threshold/job53.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/final/no_threshold/job53.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/final/no_threshold/job53.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 32.978903 | 118 | 0.69153 |
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras.callbacks import ReduceLROn... | true | true |
1c33327019a9318a80800e8752a3c80c71bc8dcd | 7,953 | py | Python | configs/fusion_consis/xmuda/src_ctr_usa_v1_w2.py | XYHC-MMDA/Multi-modal-Multi-task-DA | ed8297eb489d50c580795713cccb72bc958f406f | [
"Apache-2.0"
] | 1 | 2020-11-05T19:51:23.000Z | 2020-11-05T19:51:23.000Z | configs/fusion_consis/xmuda/src_ctr_usa_v1_w2.py | XYHC-MMDA/Multi-modal-Multi-task-DA | ed8297eb489d50c580795713cccb72bc958f406f | [
"Apache-2.0"
] | null | null | null | configs/fusion_consis/xmuda/src_ctr_usa_v1_w2.py | XYHC-MMDA/Multi-modal-Multi-task-DA | ed8297eb489d50c580795713cccb72bc958f406f | [
"Apache-2.0"
] | null | null | null | # the same as src_ctr_usa_v1.py except for max_pts = 512
##############################################
# variants: Runner, model
# options: class_weights
##############################################
# runner
# runner = 'XmudaRunner' # for any customized runner, use general_train.py
only_contrast = False # default ... | 34.133047 | 120 | 0.655979 | only_contrast = False
model_type = 'SegFusionV3'
contrast_criterion = dict(type='NT_Xent', temperature=0.1, normalize=True, contrast_mode='cross_entropy')
max_pts = 512
lambda_contrast = 0.1
img_feat_channels = 64
pts_feat_dim = 16
prelogits_dim = img_feat_channels + pts_feat_dim
scn_scale = 20
scn_full_scale = 40... | true | true |
1c33329b62c08f717b74feb9b3ec27e82debf45c | 2,876 | py | Python | Project/src/Modules/House/Family/Upb/upb_device.py | DBrianKimmel/PyHouse | a100fc67761a22ae47ed6f21f3c9464e2de5d54f | [
"MIT"
] | 3 | 2016-11-16T00:37:58.000Z | 2019-11-10T13:10:19.000Z | Project/src/Modules/House/Family/Upb/upb_device.py | DBrianKimmel/PyHouse | a100fc67761a22ae47ed6f21f3c9464e2de5d54f | [
"MIT"
] | null | null | null | Project/src/Modules/House/Family/Upb/upb_device.py | DBrianKimmel/PyHouse | a100fc67761a22ae47ed6f21f3c9464e2de5d54f | [
"MIT"
] | 1 | 2020-07-19T22:06:52.000Z | 2020-07-19T22:06:52.000Z | """
@name: Modules/families/UPB/UPB_device.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2011-2020 by D. Brian Kimmel
@license: MIT License
@note: Created on Mar 27, 2011
@summary: This module is for communicating with UPB controllers.
Load the database with UPB devic... | 35.506173 | 107 | 0.650556 |
__updated__ = '2020-02-19'
from Modules.Families.UPB.UPB_Pim import Api as upbPimApi
from Modules.Core import logging_pyh as Logger
LOG = Logger.getLogger('PyHouse.UPB_device ')
class lightingUtility(object):
@staticmethod
def _is_upb_active(p_controller_obj):
if p_controller_obj.Family.Name ... | true | true |
1c3332fce4b39830bc48b6785450db2bd6c00c52 | 11,547 | py | Python | lisa/tests/staging/sched_android.py | credp/lisa | c87a9a3463d55dd28ff7bb705551529a4ffd4456 | [
"Apache-2.0"
] | 1 | 2021-07-03T23:45:09.000Z | 2021-07-03T23:45:09.000Z | lisa/tests/staging/sched_android.py | QPC-database/lisa | 9cc520a11192dea02240ddcf0df53bf6d6763411 | [
"Apache-2.0"
] | null | null | null | lisa/tests/staging/sched_android.py | QPC-database/lisa | 9cc520a11192dea02240ddcf0df53bf6d6763411 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2019, Arm Limited and contributors.
#
# 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
#
# ... | 35.097264 | 122 | 0.639993 |
import os
import os.path
import abc
from lisa.wlgen.rta import RTAPhase, PeriodicWload
from lisa.tests.base import TestBundleBase, TestBundle, ResultBundle, RTATestBundle, AggregatedResultBundle
from lisa.trace import requires_events
from lisa.target import Target
from lisa.utils import ArtifactPath, kwargs_forwarded... | true | true |
1c33333bbb025761b13dfdd9658ef772ab03d251 | 32,653 | py | Python | ckan/views/resource.py | end2end8x/ckan | 45ee306de2f667484b2d086519fb5335a73e36a5 | [
"Apache-2.0"
] | 58 | 2015-01-11T09:05:15.000Z | 2022-03-17T23:44:07.000Z | ckan/views/resource.py | end2end8x/ckan | 45ee306de2f667484b2d086519fb5335a73e36a5 | [
"Apache-2.0"
] | 1,467 | 2015-01-01T16:47:44.000Z | 2022-02-28T16:51:20.000Z | ckan/views/resource.py | end2end8x/ckan | 45ee306de2f667484b2d086519fb5335a73e36a5 | [
"Apache-2.0"
] | 17 | 2015-05-06T14:04:21.000Z | 2021-11-11T19:58:16.000Z | # encoding: utf-8
import cgi
import json
import logging
import flask
from flask.views import MethodView
import six
import ckan.lib.base as base
import ckan.lib.datapreview as lib_datapreview
import ckan.lib.helpers as h
import ckan.lib.navl.dictization_functions as dict_fns
import ckan.lib.uploader as uploader
import... | 33.490256 | 79 | 0.578017 | import cgi
import json
import logging
import flask
from flask.views import MethodView
import six
import ckan.lib.base as base
import ckan.lib.datapreview as lib_datapreview
import ckan.lib.helpers as h
import ckan.lib.navl.dictization_functions as dict_fns
import ckan.lib.uploader as uploader
import ckan.logic as log... | true | true |
1c3333803a99fbaa0e4a9b9243428d076cd7b431 | 5,362 | py | Python | discord/template.py | jonasbohmann/discord.py | a63ced9c6910b92acc06e6c0d9f50f1ce495b18b | [
"MIT"
] | 2 | 2020-11-19T09:41:26.000Z | 2021-12-07T12:08:55.000Z | discord/template.py | jonasbohmann/discord.py | a63ced9c6910b92acc06e6c0d9f50f1ce495b18b | [
"MIT"
] | null | null | null | discord/template.py | jonasbohmann/discord.py | a63ced9c6910b92acc06e6c0d9f50f1ce495b18b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights t... | 31.356725 | 96 | 0.657404 |
from .utils import parse_time, _get_as_snowflake, _bytes_to_base64_data
from .enums import VoiceRegion
from .guild import Guild
__all__ = (
'Template',
)
class _FriendlyHttpAttributeErrorHelper:
__slots__ = ()
def __getattr__(self, attr):
raise AttributeError('PartialTemplateState does not supp... | true | true |
1c333452ebe6f0e0869a6644f68e01a17c05280f | 3,226 | py | Python | services/scheduling/tests/jrpc/test_compatibility.py | rtubio/server | 3bb15f4d4dcd543d6f95d1fda2cb737de0bb9a9b | [
"Apache-2.0"
] | 4 | 2015-03-23T16:34:53.000Z | 2017-12-12T11:41:54.000Z | services/scheduling/tests/jrpc/test_compatibility.py | rtubio/server | 3bb15f4d4dcd543d6f95d1fda2cb737de0bb9a9b | [
"Apache-2.0"
] | 42 | 2015-01-08T22:21:04.000Z | 2021-12-13T19:48:44.000Z | services/scheduling/tests/jrpc/test_compatibility.py | rtubio/server | 3bb15f4d4dcd543d6f95d1fda2cb737de0bb9a9b | [
"Apache-2.0"
] | 2 | 2015-04-04T15:23:35.000Z | 2017-07-23T23:14:06.000Z |
import logging
from django import test
from services.common import helpers as db_tools
from services.scheduling.jrpc.views import compatibility as compatibility_jrpc
"""
Copyright 2015 Ricardo Tubio-Pardavila
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except ... | 32.26 | 79 | 0.66491 |
import logging
from django import test
from services.common import helpers as db_tools
from services.scheduling.jrpc.views import compatibility as compatibility_jrpc
__author__ = 'rtubiopa@calpoly.edu'
class TestCompatibilityViews(test.TestCase):
def setUp(self):
self.__verbose_testing = False
... | true | true |
1c33358672906e92d07484e42457ecde63e16919 | 11,221 | py | Python | pypy/interpreter/pyparser/pytokenize.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | pypy/interpreter/pyparser/pytokenize.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | pypy/interpreter/pyparser/pytokenize.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 30 | 2018-08-20T03:16:34.000Z | 2022-01-12T17:39:22.000Z | # ______________________________________________________________________
"""Module pytokenize
THIS FILE WAS COPIED FROM pypy/module/parser/pytokenize.py AND ADAPTED
TO BE ANNOTABLE (Mainly made lists homogeneous)
This is a modified version of Ka-Ping Yee's tokenize module found in the
Python standard library.
The pr... | 29.843085 | 78 | 0.387131 |
from pypy.interpreter.pyparser import automata
__all__ = [ "tokenize" ]
accepts = [True, True, True, True, True, True, True, True,
True, True, False, True, True, True, True, False,
False, False, True, False, False, True, False,
False, True, False, True, False, True, False,
... | true | true |
1c3336890a8d0e233dbb651635e44b8a59ac72c8 | 7,181 | py | Python | src/rgt/THOR/binom_hmm.py | mguo123/pan_omics | e1cacd543635b398fb08c0b31d08fa6b7c389658 | [
"MIT"
] | null | null | null | src/rgt/THOR/binom_hmm.py | mguo123/pan_omics | e1cacd543635b398fb08c0b31d08fa6b7c389658 | [
"MIT"
] | null | null | null | src/rgt/THOR/binom_hmm.py | mguo123/pan_omics | e1cacd543635b398fb08c0b31d08fa6b7c389658 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
THOR detects differential peaks in multiple ChIP-seq profiles associated
with two distinct biological conditions.
Copyright (C) 2014-2016 Manuel Allhoff (allhoff@aices.rwth-aachen.de)
This program is free software: you can redistribute it and/or modify
it under the te... | 39.027174 | 156 | 0.58613 |
from __future__ import print_function
import sys
import string
import numpy as np
from scipy.stats import binom
from hmmlearn.hmm import _BaseHMM
from help_hmm import _valid_posteriors
def get_init_parameters(s1, s2, **info):
n_ = np.array([info['count'], info['count']])
m_ =[float(np.argmax(np.bincount(m... | true | true |
1c3337b4228671c7b2f5d125c8ec33d2f9fa971e | 26,053 | py | Python | postprocessing_preBotBot/doPost.py | JoshMend/prebotc-graph-model | 4002e51ab965be366b30c2a6d900ac288fa41245 | [
"BSD-3-Clause"
] | null | null | null | postprocessing_preBotBot/doPost.py | JoshMend/prebotc-graph-model | 4002e51ab965be366b30c2a6d900ac288fa41245 | [
"BSD-3-Clause"
] | null | null | null | postprocessing_preBotBot/doPost.py | JoshMend/prebotc-graph-model | 4002e51ab965be366b30c2a6d900ac288fa41245 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
'''
This file does all the post processing for a given mat file at once. This includes:
1) Deleting Transient
2)Binning the spikes
3)Filter spikes using gaussian distribution
4)Using butterworth filter to remove high frequency signals to smooth
5)Finds Phase Lag and Population Correlation
'''... | 37.757971 | 188 | 0.630446 | import sys
import numpy as np
import scipy.signal
import scipy.io
import argparse
import networkx as nx
import matplotlib.pyplot as plt
import cmath
import math
maxorder=20
eta_norm_pts = 10
def parse_args(argv):
transient = 10000 spike_thresh = -20 f_sigma = 20 butter_high = 4 butter_low = -... | true | true |
1c33382a90cfba888a05b51de0ec3f4456a3473f | 4,373 | py | Python | Code/fun3.py | HalforcNull/Research_PatternRecognition | e9cbe8df75ae775e0ed813ac4956973b4e857979 | [
"MIT"
] | null | null | null | Code/fun3.py | HalforcNull/Research_PatternRecognition | e9cbe8df75ae775e0ed813ac4956973b4e857979 | [
"MIT"
] | null | null | null | Code/fun3.py | HalforcNull/Research_PatternRecognition | e9cbe8df75ae775e0ed813ac4956973b4e857979 | [
"MIT"
] | null | null | null | """
Elevator Maintenance
====================
You've been assigned the onerous task of elevator maintenance - ugh! It wouldn't be so bad, except that all the elevator documentation has been lying in a disorganized pile at the bottom of a filing cabinet for years, and you don't even know what elevator version numbers y... | 40.490741 | 707 | 0.576263 |
class node:
left = None
right = None
father = None
value = ''
def __init__(self, v, father):
self.value = v
self.father = father
def isBefore(self, n):
lc = self.value.split('.')
ln = n.split('.')
for i in range(0, min(len(lc), len(ln))):
... | true | true |
1c333855ffae6255eb2af9e2088e8ddac49d027a | 8,938 | py | Python | analytics/common/runva.py | dhaval-zala/smart_city_ | c555253b57c442cb27e1e5a642cce25ae8bfa564 | [
"BSD-3-Clause"
] | null | null | null | analytics/common/runva.py | dhaval-zala/smart_city_ | c555253b57c442cb27e1e5a642cce25ae8bfa564 | [
"BSD-3-Clause"
] | null | null | null | analytics/common/runva.py | dhaval-zala/smart_city_ | c555253b57c442cb27e1e5a642cce25ae8bfa564 | [
"BSD-3-Clause"
] | 1 | 2022-03-23T12:07:41.000Z | 2022-03-23T12:07:41.000Z | #!/usr/bin/python3
from db_common import DBCommon
from db_query import DBQuery
from paho.mqtt.client import Client
from db_ingest import DBIngest
from threading import Event
from vaserving.vaserving import VAServing
from vaserving.pipeline import Pipeline
from configuration import env
import time
import traceback
impo... | 43.6 | 103 | 0.426046 |
from db_common import DBCommon
from db_query import DBQuery
from paho.mqtt.client import Client
from db_ingest import DBIngest
from threading import Event
from vaserving.vaserving import VAServing
from vaserving.pipeline import Pipeline
from configuration import env
import time
import traceback
import psutil
mqtthost... | true | true |
1c33391aac998ba80be1193d3b8412ce2e951685 | 8,400 | py | Python | src/vanguards/config.py | mikeperry-tor/vanguards | 10942de93f6578f8303f60014f34de2fca345545 | [
"MIT"
] | 132 | 2018-01-17T22:35:22.000Z | 2022-03-19T08:35:41.000Z | src/vanguards/config.py | mikeperry-tor/vanguards | 10942de93f6578f8303f60014f34de2fca345545 | [
"MIT"
] | 87 | 2018-05-25T23:20:24.000Z | 2022-02-02T08:41:08.000Z | src/vanguards/config.py | mikeperry-tor/vanguards | 10942de93f6578f8303f60014f34de2fca345545 | [
"MIT"
] | 22 | 2018-05-29T10:47:48.000Z | 2022-03-15T03:45:04.000Z | """ This file contains configuration defaults, options parsing, and config
file code.
"""
import argparse
import ipaddress
import os
import socket
import sys
from . import bandguards
from . import rendguard
from . import vanguards
from . import control
from . import logger
from .logger import plog
try:
from co... | 35.146444 | 115 | 0.686905 | import argparse
import ipaddress
import os
import socket
import sys
from . import bandguards
from . import rendguard
from . import vanguards
from . import control
from . import logger
from .logger import plog
try:
from configparser import SafeConfigParser, Error
except ImportError:
from ConfigParser import SafeC... | true | true |
1c333aa93800b8a44a18eb736edabe8885f9321e | 6,000 | py | Python | cidd/run-cidd-in-docker.py | NCAR/lrose-displays | c12e98c6890a5efdd4abe95a36b9004e0d83fe74 | [
"BSD-2-Clause"
] | null | null | null | cidd/run-cidd-in-docker.py | NCAR/lrose-displays | c12e98c6890a5efdd4abe95a36b9004e0d83fe74 | [
"BSD-2-Clause"
] | null | null | null | cidd/run-cidd-in-docker.py | NCAR/lrose-displays | c12e98c6890a5efdd4abe95a36b9004e0d83fe74 | [
"BSD-2-Clause"
] | 2 | 2021-07-02T06:20:59.000Z | 2022-01-28T06:23:58.000Z | #!/usr/bin/env python
#===========================================================================
#
# Run CIDD in docker. Wrapper script.
#
# This script performs the following steps:
#
# 1. clone lrose-core from git
# 2. clone lrose-netcdf from git
# 3. setup autoconf Makefile.am files
# 4. run configure to ... | 31.413613 | 294 | 0.543667 |
from __future__ import print_function
import os
import sys
from sys import platform
import shutil
import subprocess
from optparse import OptionParser
import time
from datetime import datetime
from datetime import date
from datetime import timedelta
def main():
global options
thisScriptName = os.path.... | true | true |
1c333b08d4042cb9cf835653ded7ce018942773f | 154 | py | Python | src/python-village/ini4-conditions-and-loops.py | spencerking/rosalind | 66c50378813abf7b9cc535a963aeb9249d8a3ed7 | [
"BSD-3-Clause"
] | null | null | null | src/python-village/ini4-conditions-and-loops.py | spencerking/rosalind | 66c50378813abf7b9cc535a963aeb9249d8a3ed7 | [
"BSD-3-Clause"
] | null | null | null | src/python-village/ini4-conditions-and-loops.py | spencerking/rosalind | 66c50378813abf7b9cc535a963aeb9249d8a3ed7 | [
"BSD-3-Clause"
] | null | null | null | def main(a, b):
result = 0
for i in range(a, b+1):
if i % 2 != 0:
result += i
return result
print(main(4862, 9002))
| 15.4 | 27 | 0.461039 | def main(a, b):
result = 0
for i in range(a, b+1):
if i % 2 != 0:
result += i
return result
print(main(4862, 9002))
| true | true |
1c333c5a0e8d89b3154871874c0ce9f7c532675b | 13,510 | py | Python | discordSuperUtils/base.py | StawaDev/discord-super-utils | 2734700c82dba1ed28131535d86b5a0b260ac824 | [
"MIT"
] | null | null | null | discordSuperUtils/base.py | StawaDev/discord-super-utils | 2734700c82dba1ed28131535d86b5a0b260ac824 | [
"MIT"
] | null | null | null | discordSuperUtils/base.py | StawaDev/discord-super-utils | 2734700c82dba1ed28131535d86b5a0b260ac824 | [
"MIT"
] | null | null | null | from __future__ import annotations
import asyncio
import dataclasses
import inspect
import logging
from dataclasses import dataclass
from typing import (
List,
Any,
Iterable,
Optional,
TYPE_CHECKING,
Union,
Tuple,
Callable,
Dict,
Coroutine,
)
import aiomysql
try:
import ai... | 27.237903 | 117 | 0.623316 | from __future__ import annotations
import asyncio
import dataclasses
import inspect
import logging
from dataclasses import dataclass
from typing import (
List,
Any,
Iterable,
Optional,
TYPE_CHECKING,
Union,
Tuple,
Callable,
Dict,
Coroutine,
)
import aiomysql
try:
import ai... | true | true |
1c333c80bcf6e629732d06ee24c7f63afee6c56e | 1,861 | py | Python | soundrts/res.py | Finnboy94/soundrts | 284ffe2c507f4c9e44b4e5fa8c4ef05b6614c6c6 | [
"BSD-3-Clause"
] | 23 | 2015-04-02T16:54:08.000Z | 2022-03-02T09:48:04.000Z | soundrts/res.py | Finnboy94/soundrts | 284ffe2c507f4c9e44b4e5fa8c4ef05b6614c6c6 | [
"BSD-3-Clause"
] | 94 | 2015-03-25T21:05:45.000Z | 2021-12-22T20:05:42.000Z | soundrts/res.py | TifloDev/soundrts | 209695ed80b8746facdcb35f446f0f855c48da84 | [
"BSD-3-Clause"
] | 33 | 2015-05-27T05:53:14.000Z | 2021-12-08T02:45:44.000Z | """SoundRTS resource manager"""
import os
from . import config, options
from .lib.resource import ResourceLoader
from .paths import MAPS_PATHS
def get_all_packages_paths():
"""return the default "maps and mods" paths followed by the paths of the active packages"""
return MAPS_PATHS # + package_manager.get_... | 23.556962 | 95 | 0.699624 |
import os
from . import config, options
from .lib.resource import ResourceLoader
from .paths import MAPS_PATHS
def get_all_packages_paths():
return MAPS_PATHS
if options.mods is not None:
mods = options.mods
else:
mods = config.mods
_r = ResourceLoader(mods, config.soundpacks, get_all_packages_paths(... | true | true |
1c333d0051d4c4cf7ff7cd86bb2a6b0e789d47e6 | 3,434 | py | Python | DataModelling_PostgreSQL/etl.py | RammySekham/Data-Engineering | eec1020defe9c54403f6a80ba91fc071ed22b727 | [
"MIT"
] | 1 | 2021-06-08T15:49:50.000Z | 2021-06-08T15:49:50.000Z | DataModelling_PostgreSQL/etl.py | RammySekham/Data-Engineering | eec1020defe9c54403f6a80ba91fc071ed22b727 | [
"MIT"
] | null | null | null | DataModelling_PostgreSQL/etl.py | RammySekham/Data-Engineering | eec1020defe9c54403f6a80ba91fc071ed22b727 | [
"MIT"
] | null | null | null | import os
import glob
import psycopg2
import pandas as pd
import settings
from sql_queries import *
def process_song_file(cur, filepath):
"""
process the json song file to insert song record into SQL table
"""
# open song file
df = pd.read_json(filepath, lines=True)
# insert song record
... | 31.218182 | 151 | 0.647059 | import os
import glob
import psycopg2
import pandas as pd
import settings
from sql_queries import *
def process_song_file(cur, filepath):
df = pd.read_json(filepath, lines=True)
song_data = df[['song_id', 'title', 'artist_id', 'year', 'duration']].values[0]
cur.execute(song_table_insert, son... | true | true |
1c333e6fb73118b48b9d8dd4e0ef09d56c4dbb63 | 470 | py | Python | bin/rehex.py | HashRentalCoin/sentinel | f8ddd4682a485c10f151968e130123597994b2fb | [
"MIT"
] | null | null | null | bin/rehex.py | HashRentalCoin/sentinel | f8ddd4682a485c10f151968e130123597994b2fb | [
"MIT"
] | null | null | null | bin/rehex.py | HashRentalCoin/sentinel | f8ddd4682a485c10f151968e130123597994b2fb | [
"MIT"
] | null | null | null | import simplejson
import binascii
import sys
import pdb
from pprint import pprint
import sys
import os
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib')))
import hashrentalcoinlib
# ============================================================================
usage = "%s <hex>" % sys.arg... | 21.363636 | 84 | 0.6 | import simplejson
import binascii
import sys
import pdb
from pprint import pprint
import sys
import os
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib')))
import hashrentalcoinlib
usage = "%s <hex>" % sys.argv[0]
obj = None
if len(sys.argv) < 2:
print(usage)
sys.exit(1)
else:
... | true | true |
1c333f90187e1951964e824ce8ea4d592a06fada | 8,791 | py | Python | vim/autoload/conque_term/conque_sole_wrapper.py | adifinem/dotvim | 73d1acc3cfa457ad3790a5b4612dc7479d6a7019 | [
"0BSD"
] | 413 | 2015-01-27T04:34:18.000Z | 2019-05-15T07:37:18.000Z | home/.vim/autoload/conque_term/conque_sole_wrapper.py | khilnani/dot_files | 6f8d40e5137e9c207023aff5e540c1ff3c00cff3 | [
"MIT"
] | 11 | 2015-03-03T08:34:44.000Z | 2018-09-22T22:18:55.000Z | home/.vim/autoload/conque_term/conque_sole_wrapper.py | khilnani/dot_files | 6f8d40e5137e9c207023aff5e540c1ff3c00cff3 | [
"MIT"
] | 107 | 2015-05-29T02:27:34.000Z | 2019-05-03T22:58:47.000Z | # FILE: autoload/conque_term/conque_sole_wrapper.py
# AUTHOR: Nico Raffo <nicoraffo@gmail.com>
# WEBSITE: http://conque.googlecode.com
# MODIFIED: 2011-09-02
# VERSION: 2.3, for Vim 7.0
# LICENSE:
# Conque - Vim terminal/console emulator
# Copyright (C) 2009-2011 Nico Raffo
#
# MIT License
#
# Permission is he... | 31.508961 | 204 | 0.639859 |
import ctypes
import time
class ConqueSoleWrapper():
shm_key = ''
handle = None
pid = None
bucket = None
lines = 24
columns = 80
shm_input = None
shm_output = None
shm_attributes = None
shm_stats = None
shm_command = None
shm_rescroll = None
... | true | true |
1c334168306f7a6a86168569011754df1514469c | 7,674 | py | Python | cloudcafe/auth/provider.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | null | null | null | cloudcafe/auth/provider.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | null | null | null | cloudcafe/auth/provider.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | null | null | null | """
Copyright 2013 Rackspace
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
dist... | 40.603175 | 79 | 0.68061 | from cafe.drivers.unittest.decorators import memoized
from cloudcafe.auth.config import UserAuthConfig, UserConfig
from cloudcafe.extensions.rax_auth.v2_0.tokens_api.client import \
TokenAPI_Client as RaxTokenAPI_Client, \
MFA_TokenAPI_Client as RaxToken_MFA_API_Client
from cloudcafe.extensions.rax_auth.v2_0.t... | true | true |
1c3342a0fa5ffa4a0acc71147447042416e8f56a | 6,635 | py | Python | tests/integration/output/test_output.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-31T22:51:16.000Z | 2020-03-31T22:51:16.000Z | tests/integration/output/test_output.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/integration/output/test_output.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: Nicole Thomas <nicole@saltstack.com>
'''
# Import Salt Libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import traceback
# Import Salt Testing Libs
from tests.support.case import ShellCase
from tests.support.mixins import RUNTIME_VARS... | 36.059783 | 92 | 0.592766 |
from __future__ import absolute_import, print_function, unicode_literals
import os
import traceback
from tests.support.case import ShellCase
from tests.support.mixins import RUNTIME_VARS
import salt.config
import salt.utils.yaml
from salt.output import display_output
from salt.ext import six
class OutputReturnTest... | true | true |
1c3344b206e7fa14a4a0cf6e031ac64c55973a92 | 1,753 | py | Python | electrum_mona/gui/qt/qrwindow.py | zcore-dev/electrum-mona | 2beb0c9c7794e8b03d1725bae41ee8b792c57275 | [
"MIT"
] | null | null | null | electrum_mona/gui/qt/qrwindow.py | zcore-dev/electrum-mona | 2beb0c9c7794e8b03d1725bae41ee8b792c57275 | [
"MIT"
] | null | null | null | electrum_mona/gui/qt/qrwindow.py | zcore-dev/electrum-mona | 2beb0c9c7794e8b03d1725bae41ee8b792c57275 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2014 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including... | 38.108696 | 71 | 0.725613 |
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QHBoxLayout, QWidget
from .qrcodewidget import QRCodeWidget
from electrum_mona.i18n import _
class QR_Window(QWidget):
def __init__(self, win):
QWidget.__init__(self)
self.win = win
self.setWindowTitle('Electrum - '+... | true | true |
1c3344d6bd423d534da455d71038b44401ebed57 | 3,849 | py | Python | transfer_learn_model.py | MauriceKarrenbrock/reinvent-memory | 57860dabb6534daf14fe2ab81d57589a90760442 | [
"MIT"
] | null | null | null | transfer_learn_model.py | MauriceKarrenbrock/reinvent-memory | 57860dabb6534daf14fe2ab81d57589a90760442 | [
"MIT"
] | null | null | null | transfer_learn_model.py | MauriceKarrenbrock/reinvent-memory | 57860dabb6534daf14fe2ab81d57589a90760442 | [
"MIT"
] | null | null | null | # coding=utf-8
import argparse
import logging
from typing import List
import numpy as np
import torch
from rdkit import Chem
from rdkit import rdBase
from torch.utils.data import DataLoader
from tqdm import tqdm
import models.reinvent
from chem import smiles
from models.reinvent.dataset import Dataset
from utils imp... | 43.738636 | 116 | 0.637049 |
import argparse
import logging
from typing import List
import numpy as np
import torch
from rdkit import Chem
from rdkit import rdBase
from torch.utils.data import DataLoader
from tqdm import tqdm
import models.reinvent
from chem import smiles
from models.reinvent.dataset import Dataset
from utils import decrease_le... | true | true |
1c3346169c6bab4811d070c2ac8b31e6fa4fdb84 | 24,960 | py | Python | python/tvm/testing.py | dvhg/tvm | 288e9ef41d7884cea3d868d6d2bbb672c058757b | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 90 | 2019-01-26T00:38:49.000Z | 2022-03-11T23:12:34.000Z | python/tvm/testing.py | dvhg/tvm | 288e9ef41d7884cea3d868d6d2bbb672c058757b | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 91 | 2019-02-27T00:17:01.000Z | 2022-02-21T18:08:21.000Z | python/tvm/testing.py | dvhg/tvm | 288e9ef41d7884cea3d868d6d2bbb672c058757b | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 41 | 2019-01-28T14:37:03.000Z | 2022-03-31T03:58:57.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 u... | 32.206452 | 97 | 0.626282 |
import logging
import os
import sys
import time
import pytest
import numpy as np
import tvm
import tvm.arith
import tvm.tir
import tvm.te
import tvm._ffi
from tvm.contrib import nvcc
def assert_allclose(actual, desired, rtol=1e-7, atol=1e-7):
actual = np.asanyarray(actual)
desired = np.asanyarray(desired)
... | true | true |
1c3346bb5441b4ef67bd9069e53e3e12aee53d3a | 411 | py | Python | experiments/fdtd-2d/tmp_files/4665.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/fdtd-2d/tmp_files/4665.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/fdtd-2d/tmp_files/4665.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/fdtd-2d/tmp_files/4665.c')
procedure('kernel_fdtd_2d')
loop(0)
known(' nx > 1 ')
known(' ny > 1 ')
t... | 22.833333 | 116 | 0.720195 | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/fdtd-2d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/fdtd-2d/tmp_files/4665.c')
procedure('kernel_fdtd_2d')
loop(0)
known(' nx > 1 ')
known(' ny > 1 ')
t... | true | true |
1c3347874c5ab5358cfcfa85a11e8a42aa32e186 | 1,991 | py | Python | src/robot/libdocpkg/model.py | ldtri0209/robotframework | 6bc11a350cbaf5d0801cc5431f32cc1435bb65df | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2016-01-13T13:48:28.000Z | 2021-09-05T07:14:07.000Z | src/robot/libdocpkg/model.py | ldtri0209/robotframework | 6bc11a350cbaf5d0801cc5431f32cc1435bb65df | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/libdocpkg/model.py | ldtri0209/robotframework | 6bc11a350cbaf5d0801cc5431f32cc1435bb65df | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2018-01-18T22:00:17.000Z | 2018-07-26T10:53:00.000Z | # Copyright 2008-2014 Nokia Solutions and Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 28.855072 | 75 | 0.641888 |
from __future__ import with_statement
from robot.utils import setter
from .writer import LibdocWriter
from .output import LibdocOutput
class LibraryDoc(object):
def __init__(self, name='', doc='', version='', type='library',
scope='', named_args=True, doc_format=''):
self.name = name
... | true | true |
1c3347b8d7b003cb8c724ccfeb706a04aa53091d | 728 | py | Python | bashfuscator/modules/compressors/gzip.py | 0xflotus/Bashfuscator | 0615a061336641165d5055b916e81e6db8e3a5a6 | [
"MIT"
] | 859 | 2018-08-07T02:06:01.000Z | 2022-03-24T10:00:13.000Z | bashfuscator/modules/compressors/gzip.py | 0xflotus/Bashfuscator | 0615a061336641165d5055b916e81e6db8e3a5a6 | [
"MIT"
] | 25 | 2018-09-13T19:30:17.000Z | 2022-01-05T17:53:35.000Z | bashfuscator/modules/compressors/gzip.py | 0xflotus/Bashfuscator | 0615a061336641165d5055b916e81e6db8e3a5a6 | [
"MIT"
] | 123 | 2018-08-11T02:48:36.000Z | 2022-03-30T13:46:57.000Z | import gzip
from base64 import b64encode
from bashfuscator.core.mutators.compressor import Compressor
class Gzip(Compressor):
def __init__(self):
super().__init__(
name="Gzip",
description="Compress command with gzip",
sizeRating=3,
timeRating=3,
... | 30.333333 | 118 | 0.605769 | import gzip
from base64 import b64encode
from bashfuscator.core.mutators.compressor import Compressor
class Gzip(Compressor):
def __init__(self):
super().__init__(
name="Gzip",
description="Compress command with gzip",
sizeRating=3,
timeRating=3,
... | true | true |
1c3347f5caa6ecc7a8129ca79f55c18637f4c7d9 | 1,055 | py | Python | scripts/AssetChecker/src/checker/main/main.py | sreenut/BlockChain-Framework | 3abfd5420a977573e87e3f0afcd3e6354fa4884d | [
"MIT"
] | 8 | 2018-07-18T17:49:41.000Z | 2022-03-17T01:30:44.000Z | scripts/AssetChecker/src/checker/main/main.py | sreenut/BlockChain-Framework | 3abfd5420a977573e87e3f0afcd3e6354fa4884d | [
"MIT"
] | null | null | null | scripts/AssetChecker/src/checker/main/main.py | sreenut/BlockChain-Framework | 3abfd5420a977573e87e3f0afcd3e6354fa4884d | [
"MIT"
] | 1 | 2018-09-05T07:11:25.000Z | 2018-09-05T07:11:25.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Dec 8 15:20:09 2017
@author: hpy2
"""
import requests
import json
import hashlib
from pyfiglet import Figlet
def main(filepath, trialchainip):
url = "http://{0}:9000/trialchain/data_asset".format(trialchainip)
with open(filepath, 'rb') as f:
data = f.read()... | 28.513514 | 76 | 0.603791 |
import requests
import json
import hashlib
from pyfiglet import Figlet
def main(filepath, trialchainip):
url = "http://{0}:9000/trialchain/data_asset".format(trialchainip)
with open(filepath, 'rb') as f:
data = f.read()
hasher = hashlib.md5()
hasher.update(data)
md5 = hasher.he... | true | true |
1c334a270215b12a5f4c0f304d453d9b7a73eb97 | 4,204 | py | Python | PugHelpBot/cogs/channel_clean.py | ZusorCode/PugHelpBot | 162904676bd9e876b2f69b3d3a299e3267ab8828 | [
"MIT"
] | null | null | null | PugHelpBot/cogs/channel_clean.py | ZusorCode/PugHelpBot | 162904676bd9e876b2f69b3d3a299e3267ab8828 | [
"MIT"
] | 1 | 2019-06-26T23:07:09.000Z | 2019-06-26T23:07:09.000Z | PugHelpBot/cogs/channel_clean.py | ZusorCode/PugHelpBot | 162904676bd9e876b2f69b3d3a299e3267ab8828 | [
"MIT"
] | 1 | 2019-06-24T18:41:15.000Z | 2019-06-24T18:41:15.000Z | from ..helpers import Config, get_unique_message_react_users, PingStatus, send_ping
from datetime import datetime, timedelta
import logging
import discord
from discord.ext import commands, tasks
class ChannelClean(commands.Cog):
def __init__(self, bot: commands.Bot, log: logging.Logger, config: Config, ping_statu... | 50.650602 | 134 | 0.624167 | from ..helpers import Config, get_unique_message_react_users, PingStatus, send_ping
from datetime import datetime, timedelta
import logging
import discord
from discord.ext import commands, tasks
class ChannelClean(commands.Cog):
def __init__(self, bot: commands.Bot, log: logging.Logger, config: Config, ping_statu... | true | true |
1c334ab0b122af4b812c8f5d28e1a70012bb04b0 | 4,175 | py | Python | test/functional/onix_ignore_mpos_participant_reward.py | onixcoin-io/onix | 37c158a6229fa98c1a86f8b65e91226e36355fd6 | [
"MIT"
] | 6 | 2021-10-31T04:53:09.000Z | 2021-12-16T08:27:06.000Z | test/functional/onix_ignore_mpos_participant_reward.py | onixcoin-io/onix | 37c158a6229fa98c1a86f8b65e91226e36355fd6 | [
"MIT"
] | 1 | 2021-11-29T08:45:38.000Z | 2021-11-29T08:45:38.000Z | test/functional/onix_ignore_mpos_participant_reward.py | onixcoin-io/onix | 37c158a6229fa98c1a86f8b65e91226e36355fd6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.address import *
from test_framework.onix import *
import sys
import random
import time
class OnixIgnore... | 42.602041 | 183 | 0.692216 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.address import *
from test_framework.onix import *
import sys
import random
import time
class OnixIgnoreMPOSParticipantRewardTe... | true | true |
1c334b8aca67275b6a7e930a5e216179e7a52f1a | 11,187 | py | Python | fanficfare/adapters/adapter_wwwnovelallcom.py | trishume/FanFicFare | 2ddce1acd5258f8dae5b3860aec1c9643a7a0807 | [
"Apache-2.0"
] | 3 | 2020-11-10T16:43:43.000Z | 2021-04-09T07:12:31.000Z | fanficfare/adapters/adapter_wwwnovelallcom.py | trishume/FanFicFare | 2ddce1acd5258f8dae5b3860aec1c9643a7a0807 | [
"Apache-2.0"
] | null | null | null | fanficfare/adapters/adapter_wwwnovelallcom.py | trishume/FanFicFare | 2ddce1acd5258f8dae5b3860aec1c9643a7a0807 | [
"Apache-2.0"
] | 1 | 2021-04-08T12:25:09.000Z | 2021-04-08T12:25:09.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 FanFicFare team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 41.587361 | 173 | 0.567802 |
from __future__ import absolute_import
import logging
import re
import json
from .base_adapter import BaseSiteAdapter, makeDate
from bs4 import Comment
from ..htmlcleanup import fix_excess_space, stripHTML
from .. import exceptions as exceptions
from ..dateutils import parse_relative_date_string
logger = logging.ge... | true | true |
1c334bdcd8d7ccf5ba0f8893842db5d53af4e545 | 1,996 | py | Python | LIEGE/database/table.py | seucs/entity-linker | 0156ad9b9d6439ea15518828513da9d9699b9acd | [
"Apache-2.0"
] | 4 | 2018-03-07T07:59:58.000Z | 2019-10-19T09:31:44.000Z | TabEL/database/table.py | acmom/entity-linker | 0156ad9b9d6439ea15518828513da9d9699b9acd | [
"Apache-2.0"
] | null | null | null | TabEL/database/table.py | acmom/entity-linker | 0156ad9b9d6439ea15518828513da9d9699b9acd | [
"Apache-2.0"
] | 2 | 2018-11-05T16:09:07.000Z | 2019-11-07T00:22:37.000Z | #coding=utf8
import xlrd
import xlwt
import json
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class Table:
def __init__(self, table, row_num, col_num):
self.table = table
self.row_num = row_num
self.col_num = col_num
def __getitem__(self, i):
return self.table[i]
d... | 24.048193 | 62 | 0.43988 | import xlrd
import xlwt
import json
import sys
reload(sys)
sys.setdefaultencoding('utf8')
class Table:
def __init__(self, table, row_num, col_num):
self.table = table
self.row_num = row_num
self.col_num = col_num
def __getitem__(self, i):
return self.table[i]
def getMention... | true | true |
1c334c43ec9647ed0e0ec846ea0ec8b0f1abcbfa | 1,332 | py | Python | movefiles.py | linhailan/JPG-PNG-to-MNIST-NN-Format | c2ff84cb8d2dc6cd49c4d462b4d8ea2ba4620719 | [
"Apache-2.0"
] | null | null | null | movefiles.py | linhailan/JPG-PNG-to-MNIST-NN-Format | c2ff84cb8d2dc6cd49c4d462b4d8ea2ba4620719 | [
"Apache-2.0"
] | null | null | null | movefiles.py | linhailan/JPG-PNG-to-MNIST-NN-Format | c2ff84cb8d2dc6cd49c4d462b4d8ea2ba4620719 | [
"Apache-2.0"
] | null | null | null | import os
from PIL import Image
from array import *
from random import shuffle
import shutil
def move_file(src_path, dst_path, file):
print("from : ",src_path)
print("to : ",dst_path)
try:
# cmd = 'chmod -R +x ' + src_path
# os.popen(cmd)
f_src = os.path.join(src_path, file)
... | 25.615385 | 65 | 0.553303 | import os
from PIL import Image
from array import *
from random import shuffle
import shutil
def move_file(src_path, dst_path, file):
print("from : ",src_path)
print("to : ",dst_path)
try:
f_src = os.path.join(src_path, file)
if not os.path.exists(dst_path):
... | true | true |
1c334c7a02aa7230afa09f3c7b5da4b74c2bc05b | 1,748 | py | Python | acunetix/v11/db/tables/vuln_types.py | BenDerPan/DScaner | 1552b1877185c08b0db3c48da4e5c3c601c49ce0 | [
"MIT"
] | 20 | 2017-11-09T01:47:56.000Z | 2021-03-08T07:08:10.000Z | acunetix/v11/db/tables/vuln_types.py | BenDerPan/DScaner | 1552b1877185c08b0db3c48da4e5c3c601c49ce0 | [
"MIT"
] | null | null | null | acunetix/v11/db/tables/vuln_types.py | BenDerPan/DScaner | 1552b1877185c08b0db3c48da4e5c3c601c49ce0 | [
"MIT"
] | 6 | 2017-11-09T01:48:01.000Z | 2020-04-06T11:57:05.000Z | # uncompyle6 version 2.13.2
# Python bytecode 3.5 (3351)
# Decompiled from: Python 3.5.3 (default, Jan 19 2017, 14:11:04)
# [GCC 6.3.0 20170118]
# Embedded file name: db\tables\vuln_types.py
__author__ = 'sanyi'
from sqlalchemy import *
from sqlalchemy.orm import mapper
from sqlalchemy.dialects.postgresql import UUID ... | 46 | 582 | 0.699657 | __author__ = 'sanyi'
from sqlalchemy import *
from sqlalchemy.orm import mapper
from sqlalchemy.dialects.postgresql import UUID as C_UUID
from sqlalchemy.dialects.postgresql import ARRAY as C_ARRAY
from .tables import metadata
sensor_details_template = '{{#file}}<p>Source file: <strong class="bb-dark">{{file}}</strong>... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.