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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f740b4a6de67809102d31bcb999d40f6b0552ee3 | 26,390 | py | Python | ocpmodels/trainers/forces_trainer.py | joshes/ocp | e04056d008616eaf5058b7851d8ac29b8f2da473 | [
"MIT"
] | null | null | null | ocpmodels/trainers/forces_trainer.py | joshes/ocp | e04056d008616eaf5058b7851d8ac29b8f2da473 | [
"MIT"
] | null | null | null | ocpmodels/trainers/forces_trainer.py | joshes/ocp | e04056d008616eaf5058b7851d8ac29b8f2da473 | [
"MIT"
] | null | null | null | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import os
from collections import defaultdict
import numpy as np
import torch
import torch_geometric
from torch.utils.data import DataLoader... | 39.096296 | 127 | 0.49712 |
import os
from collections import defaultdict
import numpy as np
import torch
import torch_geometric
from torch.utils.data import DataLoader, DistributedSampler
from tqdm import tqdm
from ocpmodels.common import distutils
from ocpmodels.common.data_parallel import ParallelCollater
from ocpmodels.common.registry impo... | true | true |
f740b63c7bc14f574b50ee3c0a68be13ac07f114 | 6,076 | py | Python | django/core/checks/security/base.py | bpeschier/django | f54c0ec06e390dc5bce95fdccbcb51d6423da4f9 | [
"BSD-3-Clause"
] | 39 | 2016-12-05T14:36:37.000Z | 2021-07-29T18:22:34.000Z | django/core/checks/security/base.py | bpeschier/django | f54c0ec06e390dc5bce95fdccbcb51d6423da4f9 | [
"BSD-3-Clause"
] | 68 | 2016-12-12T20:38:47.000Z | 2020-07-26T18:28:49.000Z | django/core/checks/security/base.py | bpeschier/django | f54c0ec06e390dc5bce95fdccbcb51d6423da4f9 | [
"BSD-3-Clause"
] | 120 | 2016-08-18T14:53:03.000Z | 2020-06-16T13:27:20.000Z | from django.conf import settings
from .. import Tags, Warning, register
SECRET_KEY_MIN_LENGTH = 50
SECRET_KEY_MIN_UNIQUE_CHARACTERS = 5
W001 = Warning(
"You do not have 'django.middleware.security.SecurityMiddleware' "
"in your MIDDLEWARE_CLASSES so the SECURE_HSTS_SECONDS, "
"SECURE_CONTENT_TYPE_NOSNIFF... | 32.843243 | 98 | 0.717742 | from django.conf import settings
from .. import Tags, Warning, register
SECRET_KEY_MIN_LENGTH = 50
SECRET_KEY_MIN_UNIQUE_CHARACTERS = 5
W001 = Warning(
"You do not have 'django.middleware.security.SecurityMiddleware' "
"in your MIDDLEWARE_CLASSES so the SECURE_HSTS_SECONDS, "
"SECURE_CONTENT_TYPE_NOSNIFF... | true | true |
f740b71e6b91cf892d29dabb0041c1e46760b9cc | 5,955 | py | Python | leetcode_python/Two_Pointers/linked-list-cycle-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Two_Pointers/linked-list-cycle-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Two_Pointers/linked-list-cycle-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | """
142. Linked List Cycle II
Medium
Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null.
There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote t... | 27.068182 | 322 | 0.560705 |
class Solution:
def detectCycle(self, head):
if not head or not head.next:
return
slow = fast = head
while fast and fast.next:
fast = fast.next.next
slow = slow.next
if fast == slow:
break
fast = fast.... | true | true |
f740b752199af7ec414cd7d1064ff044c6624ece | 1,595 | py | Python | pythonProject/roman_numerals.py | irisxiu666/5001 | 07ea4bac4fa7c1f961d93bdd9723716b2452adc4 | [
"MIT"
] | null | null | null | pythonProject/roman_numerals.py | irisxiu666/5001 | 07ea4bac4fa7c1f961d93bdd9723716b2452adc4 | [
"MIT"
] | null | null | null | pythonProject/roman_numerals.py | irisxiu666/5001 | 07ea4bac4fa7c1f961d93bdd9723716b2452adc4 | [
"MIT"
] | null | null | null | """ A program that is able to convert a number between 1 and 4999 (inclusive)
to a roman numeral with variables, arithmetic operators, and functions."""
def main():
# Input the number
number = roman_num = int(input('Enter number:'))
# The quotient gotten from 'number // 1000' is the number of 'M'
... | 35.444444 | 78 | 0.611912 |
def main():
number = roman_num = int(input('Enter number:'))
num1 = number // 1000
roman_num1 = 'M' * num1
number = number - num1 * 1000
num2 = number // 500
roman_num2 = roman_num1 + 'D' * num2
number = number - num2 * 500
num3 = number // 100
ro... | true | true |
f740b7f3d03a1b2995262ece22252fd841730468 | 395 | py | Python | djangoapi/asgi.py | Shaurov05/Django-Crating-Rest-API | 35ced6e659ad6773896df2136fe4942ba90c5daf | [
"MIT"
] | null | null | null | djangoapi/asgi.py | Shaurov05/Django-Crating-Rest-API | 35ced6e659ad6773896df2136fe4942ba90c5daf | [
"MIT"
] | null | null | null | djangoapi/asgi.py | Shaurov05/Django-Crating-Rest-API | 35ced6e659ad6773896df2136fe4942ba90c5daf | [
"MIT"
] | null | null | null | """
ASGI config for djangoapi project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoapi.settings')
application = get_asgi_application()
| true | true |
f740b90fa221bacddecb568df1122025bc9618c1 | 511 | py | Python | code/3.Longest-Substring-Without-Repeating-Characters-v2.py | Aden-Q/leetcode | ebd4804edd4f172b9981b22c18d9ff654cf20762 | [
"Apache-2.0"
] | 1 | 2019-09-22T03:08:14.000Z | 2019-09-22T03:08:14.000Z | code/3.Longest-Substring-Without-Repeating-Characters-v2.py | Aden-Q/leetcode | ebd4804edd4f172b9981b22c18d9ff654cf20762 | [
"Apache-2.0"
] | null | null | null | code/3.Longest-Substring-Without-Repeating-Characters-v2.py | Aden-Q/leetcode | ebd4804edd4f172b9981b22c18d9ff654cf20762 | [
"Apache-2.0"
] | null | null | null | from collections import Counter
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
if len(s) == 0:
return 0
max_length = 0
window = Counter()
left = 0
right = left
while right < len(s):
window[s[right]] += 1
while wi... | 30.058824 | 58 | 0.485323 | from collections import Counter
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
if len(s) == 0:
return 0
max_length = 0
window = Counter()
left = 0
right = left
while right < len(s):
window[s[right]] += 1
while wi... | true | true |
f740b93d64f490290c0b9732bc40769728c8d7a4 | 1,879 | py | Python | acme/setup.py | jo-so/certbot | 6d19d4df1e3e187d22fc3270cc4679611d3a7a17 | [
"Apache-2.0"
] | null | null | null | acme/setup.py | jo-so/certbot | 6d19d4df1e3e187d22fc3270cc4679611d3a7a17 | [
"Apache-2.0"
] | null | null | null | acme/setup.py | jo-so/certbot | 6d19d4df1e3e187d22fc3270cc4679611d3a7a17 | [
"Apache-2.0"
] | null | null | null | import sys
from setuptools import find_packages
from setuptools import setup
version = '1.18.0'
install_requires = [
# This dependency just exists to ensure that chardet is installed along
# with requests so it will use it instead of charset_normalizer. See
# https://github.com/certbot/certbot/issues/896... | 28.044776 | 78 | 0.63438 | import sys
from setuptools import find_packages
from setuptools import setup
version = '1.18.0'
install_requires = [
'chardet',
'cryptography>=2.1.4',
'josepy>=1.1.0',
'PyOpenSSL>=17.3.0',
'pyrfc3339',
'pytz',
'requests>=2.14.2',
'requests-toolbelt>=0.3.0... | true | true |
f740bb2a40e9bb5271037b110ef77b798f7b39c9 | 3,083 | py | Python | oh-my-zsh/custom/plugins/vcs-prompt/lib/gitstatus-fast.py | grantr/dotfiles | 39f6395de4b448db19a7e024e986bb1f5a3035f5 | [
"MIT"
] | null | null | null | oh-my-zsh/custom/plugins/vcs-prompt/lib/gitstatus-fast.py | grantr/dotfiles | 39f6395de4b448db19a7e024e986bb1f5a3035f5 | [
"MIT"
] | null | null | null | oh-my-zsh/custom/plugins/vcs-prompt/lib/gitstatus-fast.py | grantr/dotfiles | 39f6395de4b448db19a7e024e986bb1f5a3035f5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import shlex
from subprocess import Popen, PIPE, \
check_call, CalledProcessError
def run_cmd(cmd, ignore_error=False, exargs=[]):
cmd = shlex.split(cmd)
cmd.extend(exargs)
p = Popen(cmd, stdout=PIPE, std... | 26.577586 | 91 | 0.614661 |
from __future__ import print_function
import sys
import shlex
from subprocess import Popen, PIPE, \
check_call, CalledProcessError
def run_cmd(cmd, ignore_error=False, exargs=[]):
cmd = shlex.split(cmd)
cmd.extend(exargs)
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
out, error = p.communicate()
... | true | true |
f740bb3eb660cfad12dbb93a1458e8e12e24c345 | 2,675 | py | Python | saw/llvm_types.py | GaloisInc/galois-py-toolk | 101cc00e02c27b9f115d5ea1f6b8af6f0dcea856 | [
"BSD-3-Clause"
] | null | null | null | saw/llvm_types.py | GaloisInc/galois-py-toolk | 101cc00e02c27b9f115d5ea1f6b8af6f0dcea856 | [
"BSD-3-Clause"
] | 10 | 2021-02-15T16:41:42.000Z | 2021-03-12T19:36:41.000Z | saw/llvm_types.py | GaloisInc/galois-py-toolk | 101cc00e02c27b9f115d5ea1f6b8af6f0dcea856 | [
"BSD-3-Clause"
] | 2 | 2021-02-15T14:35:43.000Z | 2021-02-18T19:08:22.000Z | from abc import ABCMeta, abstractmethod
from typing import Any, List
class LLVMType(metaclass=ABCMeta):
@abstractmethod
def to_json(self) -> Any: pass
class LLVMIntType(LLVMType):
def __init__(self, width : int) -> None:
self.width = width
def to_json(self) -> Any:
return {'type': 'pr... | 31.845238 | 85 | 0.608598 | from abc import ABCMeta, abstractmethod
from typing import Any, List
class LLVMType(metaclass=ABCMeta):
@abstractmethod
def to_json(self) -> Any: pass
class LLVMIntType(LLVMType):
def __init__(self, width : int) -> None:
self.width = width
def to_json(self) -> Any:
return {'type': 'pr... | true | true |
f740bb7304d7ec0cbc752401120e1817691f24cf | 3,438 | py | Python | DataManager/Legacy/create_dataset/generate_mask_db.py | naivelogic/ZeroWaste3D | 915d4a37563db8481c8631ab0e34cfd0512941f8 | [
"MIT"
] | 2 | 2020-10-15T05:05:02.000Z | 2020-10-22T23:44:18.000Z | DataManager/Legacy/create_dataset/generate_mask_db.py | naivelogic/ZeroWaste3D | 915d4a37563db8481c8631ab0e34cfd0512941f8 | [
"MIT"
] | null | null | null | DataManager/Legacy/create_dataset/generate_mask_db.py | naivelogic/ZeroWaste3D | 915d4a37563db8481c8631ab0e34cfd0512941f8 | [
"MIT"
] | null | null | null | #%%
import sys, os, glob
import numpy as np
sys.path.append("../") # go to parent dir
from utils.coco_manager import MaskManager
## Create Train/Val/Test/ Datasets
#Train: 80%
#Val: 18%
#Test: 2%
#%%
DATASET_VERSON = 'ds2'
DATASET_PATH = f'/mnt/zerowastepublic/02-datasets/{DATASET_VERSON}/'
DATASET_RAW_FOLD... | 32.433962 | 283 | 0.688482 |
import sys, os, glob
import numpy as np
sys.path.append("../")
from utils.coco_manager import MaskManager
SET_PATH = f'/mnt/zerowastepublic/02-datasets/{DATASET_VERSON}/'
DATASET_RAW_FOLDER = f'/mnt/zerowastepublic/02-datasets/{DATASET_VERSON}/raw/'
DATASET_PATH = f'/mnt/daredevildiag/6PACK/z3d/ds1/InstanceGroup... | true | true |
f740bc16934739fdbdee620920bfaacc5d07aabc | 415 | py | Python | auctions/migrations/0009_auto_20201030_1222.py | huutrungrimp/commerce | 8a22ea44bfca69f96d721a3ebefd7729487db3cf | [
"MIT"
] | null | null | null | auctions/migrations/0009_auto_20201030_1222.py | huutrungrimp/commerce | 8a22ea44bfca69f96d721a3ebefd7729487db3cf | [
"MIT"
] | null | null | null | auctions/migrations/0009_auto_20201030_1222.py | huutrungrimp/commerce | 8a22ea44bfca69f96d721a3ebefd7729487db3cf | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-30 16:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auctions', '0008_bidlisting_bidprice'),
]
operations = [
migrations.AlterField(
model_name='bidlisting',
name='bidpr... | 21.842105 | 71 | 0.619277 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auctions', '0008_bidlisting_bidprice'),
]
operations = [
migrations.AlterField(
model_name='bidlisting',
name='bidprice',
field=models.DecimalField(dec... | true | true |
f740bc89ba9d061020c4c245165a8c29189026b2 | 1,710 | py | Python | Sprint-challenge/acme_test.py | iesous-kurios/DS-Unit-3-Sprint-1-Software-Engineering | 391f0d34a8c96dd6f45390b9ae75f92197e3c413 | [
"MIT"
] | null | null | null | Sprint-challenge/acme_test.py | iesous-kurios/DS-Unit-3-Sprint-1-Software-Engineering | 391f0d34a8c96dd6f45390b9ae75f92197e3c413 | [
"MIT"
] | null | null | null | Sprint-challenge/acme_test.py | iesous-kurios/DS-Unit-3-Sprint-1-Software-Engineering | 391f0d34a8c96dd6f45390b9ae75f92197e3c413 | [
"MIT"
] | null | null | null | import unittest
from acme import Product, BoxingGlove
from acme_report import generate_products, ADJECTIVES, NOUNS
"""Tests for Acme Python modules."""
class AcmeProductTests(unittest.TestCase):
"""Making sure Acme products are the tops!"""
def test_default_product_price(self):
"""Test ... | 34.2 | 75 | 0.649123 | import unittest
from acme import Product, BoxingGlove
from acme_report import generate_products, ADJECTIVES, NOUNS
class AcmeProductTests(unittest.TestCase):
def test_default_product_price(self):
prod = Product('Test Product')
self.assertEqual(prod.price, 10)
def test_default_... | true | true |
f740bd521c46102471b2ba19e01976bf20455c3a | 3,024 | py | Python | assignment/min_nonsmooth_fun.py | bobrokerson/libraries | 996509d341af7108a24053eb88431ec6afbb0f25 | [
"MIT"
] | null | null | null | assignment/min_nonsmooth_fun.py | bobrokerson/libraries | 996509d341af7108a24053eb88431ec6afbb0f25 | [
"MIT"
] | null | null | null | assignment/min_nonsmooth_fun.py | bobrokerson/libraries | 996509d341af7108a24053eb88431ec6afbb0f25 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 21 15:36:06 2022
@author: bobrokerson
"""
# part of code from task #1
from math import sin, exp
import numpy as np
import matplotlib.pyplot as plt
def func(x):
return sin(x / 5.) * exp(x / 10.) + 5. * exp(-x/ 2.)
xarr = np.arange(1., 31.)
p... | 37.333333 | 371 | 0.732804 |
from math import sin, exp
import numpy as np
import matplotlib.pyplot as plt
def func(x):
return sin(x / 5.) * exp(x / 10.) + 5. * exp(-x/ 2.)
xarr = np.arange(1., 31.)
print(xarr)
print("x:", xarr.shape)
yarr = np.array([func(x) for x in xarr])
print(yarr)
print("y:", yarr.shape)
plt.plot(xarr, yarr)
plt.gr... | true | true |
f740bdd17578b084ff63e05e6fc3c2ca7fab9048 | 1,448 | py | Python | src/test/ilcoin-util-test.py | ILCOINDevelopmentTeam/ilcoin-master | f6ceb8adcbd5db8d5cb8beeaf937ceb2d76bb3af | [
"MIT"
] | 21 | 2021-01-17T06:44:12.000Z | 2022-03-10T02:11:24.000Z | src/test/ilcoin-util-test.py | Borishbc/ilcoin-master | b03cebfb0296379252b991d4622c65d3628f965d | [
"MIT"
] | 2 | 2020-06-22T12:41:52.000Z | 2020-07-15T03:44:41.000Z | src/test/ilcoin-util-test.py | ILCoinDevTeam/ilcoin-master | f6ceb8adcbd5db8d5cb8beeaf937ceb2d76bb3af | [
"MIT"
] | 10 | 2019-02-28T09:33:24.000Z | 2020-09-17T11:37:59.000Z | #!/usr/bin/env python
# Copyright 2014 BitPay Inc.
# Copyright 2016 The Ilcoin Core developers
# All Rights Reserved. ILCoin Blockchain Project 2019©
from __future__ import division,print_function,unicode_literals
import os
import bctest
import buildenv
import argparse
import logging
help_text="""Test framework for il... | 32.177778 | 83 | 0.698895 |
from __future__ import division,print_function,unicode_literals
import os
import bctest
import buildenv
import argparse
import logging
help_text="""Test framework for ilcoin utils.
Runs automatically during `make check`.
Can also be run manually from the src directory by specifying the source directory:
test/il... | true | true |
f740be8e6fb21ebb8055bd873a2d43dca9a2b898 | 1,402 | py | Python | dbcreate.py | Volatar/ThuearleBot | f5ce0fbb1b3e2e71e062f0eb4d1276339cf6748c | [
"MIT"
] | null | null | null | dbcreate.py | Volatar/ThuearleBot | f5ce0fbb1b3e2e71e062f0eb4d1276339cf6748c | [
"MIT"
] | null | null | null | dbcreate.py | Volatar/ThuearleBot | f5ce0fbb1b3e2e71e062f0eb4d1276339cf6748c | [
"MIT"
] | null | null | null | import sqlite3
from dbconn import dbconnect
import codecs
db_conn = dbconnect('database/commandsDB.db')
# add here when adding commands
commands = ["tableflip", "gitgud", "heresy"]
commands_create_sql = []
for command in commands:
commands_create_sql.append(f""" CREATE TABLE IF NOT EXISTS {command} (
... | 28.612245 | 110 | 0.599144 | import sqlite3
from dbconn import dbconnect
import codecs
db_conn = dbconnect('database/commandsDB.db')
commands = ["tableflip", "gitgud", "heresy"]
commands_create_sql = []
for command in commands:
commands_create_sql.append(f""" CREATE TABLE IF NOT EXISTS {command} (
id integer... | true | true |
f740bee981a49e7ecdc96d6f958103c901bd7ed6 | 5,956 | py | Python | nearest_neighbert/evaluate.py | Poezedoez/NearestNeighBERT-Faiss | 802c9528105295abe28be8624c7582a3c0f68835 | [
"MIT"
] | null | null | null | nearest_neighbert/evaluate.py | Poezedoez/NearestNeighBERT-Faiss | 802c9528105295abe28be8624c7582a3c0f68835 | [
"MIT"
] | 4 | 2020-11-13T18:47:27.000Z | 2021-08-25T16:03:17.000Z | nearest_neighbert/evaluate.py | Poezedoez/NearestNeighBERT-Faiss | 802c9528105295abe28be8624c7582a3c0f68835 | [
"MIT"
] | null | null | null | from sklearn.metrics import precision_recall_fscore_support as prfs
import numpy as np
import json
import argparse
from typing import List, Tuple, Dict
import sys
# From spert.evaluator class
# https://github.com/markus-eberts/spert/blob/master/spert/evaluator.py
def _get_row(data, label):
row = [label]
for i... | 34.229885 | 110 | 0.635158 | from sklearn.metrics import precision_recall_fscore_support as prfs
import numpy as np
import json
import argparse
from typing import List, Tuple, Dict
import sys
def _get_row(data, label):
row = [label]
for i in range(len(data) - 1):
row.append("%.2f" % (data[i] * 100))
row.append(data[3])
... | true | true |
f740c0512cf95ab5fb10a27843263bf6216389f4 | 3,190 | py | Python | tests/data_generation/animate_berlin_x_offset.py | Algomorph/NeuralTracking | 6312be8e18828344c65e25a423c239efcd3428dd | [
"Apache-2.0"
] | 3 | 2021-04-18T04:23:08.000Z | 2022-02-01T08:37:51.000Z | tests/data_generation/animate_berlin_x_offset.py | Algomorph/NeuralTracking | 6312be8e18828344c65e25a423c239efcd3428dd | [
"Apache-2.0"
] | 24 | 2021-05-28T21:59:11.000Z | 2022-02-03T16:09:41.000Z | tests/data_generation/animate_berlin_x_offset.py | Algomorph/NeuralTracking | 6312be8e18828344c65e25a423c239efcd3428dd | [
"Apache-2.0"
] | 5 | 2021-03-10T02:56:16.000Z | 2021-12-14T06:04:50.000Z | import sys
import os
import shutil
import cv2
import open3d as o3d
import open3d.core as o3c
import numpy as np
from rendering.pytorch3d_renderer import PyTorch3DRenderer
from data import StandaloneFrameDataset
import data.presets as presets
import tsdf.default_voxel_grid
import data.camera
from settings import proce... | 43.69863 | 138 | 0.753918 | import sys
import os
import shutil
import cv2
import open3d as o3d
import open3d.core as o3c
import numpy as np
from rendering.pytorch3d_renderer import PyTorch3DRenderer
from data import StandaloneFrameDataset
import data.presets as presets
import tsdf.default_voxel_grid
import data.camera
from settings import proce... | true | true |
f740c0691f6f9fe3cd9dcdaae65c9bd929269029 | 1,069 | py | Python | data/mRNA_233x_data/reformat_kazuki2.py | eternagame/KaggleOpenVaccine | de252988b92dc2c673a80347deb8827a12aa2ad8 | [
"MIT"
] | 15 | 2021-09-23T21:22:57.000Z | 2022-03-29T06:29:44.000Z | data/mRNA_233x_data/reformat_kazuki2.py | eternagame/KaggleOpenVaccine | de252988b92dc2c673a80347deb8827a12aa2ad8 | [
"MIT"
] | null | null | null | data/mRNA_233x_data/reformat_kazuki2.py | eternagame/KaggleOpenVaccine | de252988b92dc2c673a80347deb8827a12aa2ad8 | [
"MIT"
] | 1 | 2021-09-30T17:03:20.000Z | 2021-09-30T17:03:20.000Z | import numpy as np
import pandas as pd
import gzip
input_file = 'predictions/2nd-place-233-seq.csv'
nickname='kazuki2'
df = pd.read_csv('../233x_sequences_degdata_081120.csv')
df1 = pd.read_csv(input_file)
df1['ID'] = [int(x.split('_')[0]) for x in df1['id_seqpos']]
df1['seqpos'] = [int(x.split('_')[1]) for x in df1... | 34.483871 | 116 | 0.655753 | import numpy as np
import pandas as pd
import gzip
input_file = 'predictions/2nd-place-233-seq.csv'
nickname='kazuki2'
df = pd.read_csv('../233x_sequences_degdata_081120.csv')
df1 = pd.read_csv(input_file)
df1['ID'] = [int(x.split('_')[0]) for x in df1['id_seqpos']]
df1['seqpos'] = [int(x.split('_')[1]) for x in df1... | true | true |
f740c129c791da0ebf83ccc9b742e7bb907e0d85 | 1,655 | py | Python | dpx/hosting/tasks.py | DotPodcast/dotpodcast-dpx | 5a084a07d094180eaefbb0946d274f74c1472e02 | [
"MIT"
] | 8 | 2018-06-10T20:41:50.000Z | 2021-03-05T16:33:11.000Z | dpx/hosting/tasks.py | DotPodcast/dotpodcast-dpx | 5a084a07d094180eaefbb0946d274f74c1472e02 | [
"MIT"
] | 8 | 2021-03-18T20:20:20.000Z | 2022-03-11T23:15:30.000Z | dpx/hosting/tasks.py | DotPodcast/dotpodcast-dpx | 5a084a07d094180eaefbb0946d274f74c1472e02 | [
"MIT"
] | null | null | null | from django.db import transaction
from mutagen.mp3 import MP3
from os import path
@transaction.atomic()
def fetch_feed(podcast_pk, url):
from ..validator.utils import find_validator
from .models import Podcast
import requests
import json
response = requests.get(url, stream=True)
response.rais... | 25.859375 | 71 | 0.73716 | from django.db import transaction
from mutagen.mp3 import MP3
from os import path
@transaction.atomic()
def fetch_feed(podcast_pk, url):
from ..validator.utils import find_validator
from .models import Podcast
import requests
import json
response = requests.get(url, stream=True)
response.rais... | true | true |
f740c1c6394c0ec3792c0f9afcc9707a54e5e9b9 | 10,476 | py | Python | grasso/fat.py | joakimfors/grasso | a31ed8d83739ed5e90e648c3e572d425149e6ee8 | [
"MIT"
] | 5 | 2016-10-27T23:56:53.000Z | 2021-06-11T21:05:27.000Z | grasso/fat.py | joakimfors/grasso | a31ed8d83739ed5e90e648c3e572d425149e6ee8 | [
"MIT"
] | 1 | 2018-01-13T16:09:17.000Z | 2018-01-13T16:09:17.000Z | grasso/fat.py | joakimfors/grasso | a31ed8d83739ed5e90e648c3e572d425149e6ee8 | [
"MIT"
] | 2 | 2016-04-11T17:14:14.000Z | 2020-04-18T12:00:50.000Z | # -*- encoding: utf-8 -*-
#
# Grasso - a FAT filesystem parser
#
# Copyright 2011 Emanuele Aina <em@nerd.ocracy.org>
#
# Released under the term of a MIT-style license, see LICENSE
# for details.
import math, io, pprint
from struct import unpack
from .util import FragmentInfo, FragmentedIO
class BootSector(object):
... | 32.433437 | 98 | 0.540378 |
import math, io, pprint
from struct import unpack
from .util import FragmentInfo, FragmentedIO
class BootSector(object):
length = 36
unpacker = "<3s8sHBHBHHBHHHLL"
def __init__(self, filesystem):
self.filesystem = filesystem
self.offset = self.filesystem.source.tell()
data ... | true | true |
f740c29e198f1d91e8d6d588111cb2cfa97cdbb6 | 136 | py | Python | train.py | bendemers/Halite3-SVM-Bot | ae30b821d760bd6f7e15f6094029ab78ceaa88d6 | [
"MIT"
] | null | null | null | train.py | bendemers/Halite3-SVM-Bot | ae30b821d760bd6f7e15f6094029ab78ceaa88d6 | [
"MIT"
] | null | null | null | train.py | bendemers/Halite3-SVM-Bot | ae30b821d760bd6f7e15f6094029ab78ceaa88d6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import model
m = model.HaliteModel()
m.train_on_files('training', 'aggressive')
m.save(file_name='greedy.svc')
| 17 | 42 | 0.735294 |
import model
m = model.HaliteModel()
m.train_on_files('training', 'aggressive')
m.save(file_name='greedy.svc')
| true | true |
f740c366a98f6fce9f49da2c1d02cb2feedd91e6 | 3,512 | py | Python | core/cube_sim.py | SrivenkatAnr/rcube-3x3 | 028f2ed7f2e17b07e5d44ce7e68c52e8bb692ad5 | [
"Apache-2.0"
] | null | null | null | core/cube_sim.py | SrivenkatAnr/rcube-3x3 | 028f2ed7f2e17b07e5d44ce7e68c52e8bb692ad5 | [
"Apache-2.0"
] | null | null | null | core/cube_sim.py | SrivenkatAnr/rcube-3x3 | 028f2ed7f2e17b07e5d44ce7e68c52e8bb692ad5 | [
"Apache-2.0"
] | null | null | null | from .legacy_cube import CubeClass
class Cube(CubeClass):
def __init__(self,faces):
super().__init__(faces)
self.algo = []
self.rotation_dict = {'r':lambda x:x.R(),\
'l':lambda x:x.L(),\
'u':lambda x:x.U(),\
'f':lambda x:x.F(),\
'b':lambda x:x.B(),\
'd':lambda x:x.D(... | 22.805195 | 71 | 0.557802 | from .legacy_cube import CubeClass
class Cube(CubeClass):
def __init__(self,faces):
super().__init__(faces)
self.algo = []
self.rotation_dict = {'r':lambda x:x.R(),\
'l':lambda x:x.L(),\
'u':lambda x:x.U(),\
'f':lambda x:x.F(),\
'b':lambda x:x.B(),\
'd':lambda x:x.D(... | true | true |
f740c474e8a02fdebdc385aa330790e7549e6c27 | 412 | py | Python | myproject/wsgi.py | bpomerenke/heroku_django_poc | 68569436c0d335dd7afe22c82eba44be12f7697f | [
"MIT"
] | null | null | null | myproject/wsgi.py | bpomerenke/heroku_django_poc | 68569436c0d335dd7afe22c82eba44be12f7697f | [
"MIT"
] | 7 | 2019-10-22T14:15:59.000Z | 2022-02-10T08:50:49.000Z | myproject/wsgi.py | sureshkunku/Dispatch | eda68d5bf94029a324d22f5b6eb6c5087923ab7e | [
"MIT"
] | null | null | null | """
WSGI config for myproject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefau... | 24.235294 | 79 | 0.757282 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
application = get_wsgi_application()
| true | true |
f740c4a51217a57212ae7263da233a134de620cc | 5,926 | py | Python | python/opscore/RO/Wdg/CmdWdg.py | sdss/opscore | dd4f2b2ad525fe3dfe3565463de2c079a7e1232e | [
"BSD-3-Clause"
] | null | null | null | python/opscore/RO/Wdg/CmdWdg.py | sdss/opscore | dd4f2b2ad525fe3dfe3565463de2c079a7e1232e | [
"BSD-3-Clause"
] | 1 | 2021-08-17T21:08:14.000Z | 2021-08-17T21:08:14.000Z | python/opscore/RO/Wdg/CmdWdg.py | sdss/opscore | dd4f2b2ad525fe3dfe3565463de2c079a7e1232e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""Entry widget for commands, with history.
History:
2002-11-13 ROwen Added history. Bug fix: entering a command would not
scroll all the way to the bottom if data was coming in; fixed using
a carefully placed update_idletasks (we'll see if this always ... | 36.134146 | 97 | 0.614242 |
__all__ = ['CmdWdg']
from six.moves import tkinter
from . import Entry
class CmdWdg (Entry.StrEntry):
def __init__ (self,
master,
cmdFunc,
maxCmds=50,
helpURL = None,
**kargs):
Entry.StrEntry.__init__(self,
master = master,
helpURL = helpURL,
... | true | true |
f740c585a03d014410fc920058bd8a773848dd26 | 458 | py | Python | permute/Solution.py | lordlamb/leetcode | ac270ab6301bcd712b655bca4d6f1ce1e066bce2 | [
"MIT"
] | null | null | null | permute/Solution.py | lordlamb/leetcode | ac270ab6301bcd712b655bca4d6f1ce1e066bce2 | [
"MIT"
] | null | null | null | permute/Solution.py | lordlamb/leetcode | ac270ab6301bcd712b655bca4d6f1ce1e066bce2 | [
"MIT"
] | null | null | null | """
给定一个没有重复数字的序列,返回其所有可能的全排列。
"""
from typing import List
class Solution:
def permute(self, nums: List[int]) -> List[List[int]]:
if len(nums) == 1:
return [nums]
else:
ret = []
for i in range(len(nums)):
sub_permute = self.permute(nums[0:i] + n... | 20.818182 | 77 | 0.49345 |
from typing import List
class Solution:
def permute(self, nums: List[int]) -> List[List[int]]:
if len(nums) == 1:
return [nums]
else:
ret = []
for i in range(len(nums)):
sub_permute = self.permute(nums[0:i] + nums[i + 1:len(nums)])
... | true | true |
f740c641c8ce16f61b85aa2d13c4c3910ac781c7 | 4,412 | py | Python | dragDropInstall.py | lukasstudio/depthOfFieldTool | 03fedb4453a1e8498362c4732ce2b953db1cd718 | [
"MIT"
] | 2 | 2022-02-09T13:59:50.000Z | 2022-03-08T16:40:45.000Z | dragDropInstall.py | lukasstudio/depthOfFieldTool | 03fedb4453a1e8498362c4732ce2b953db1cd718 | [
"MIT"
] | null | null | null | dragDropInstall.py | lukasstudio/depthOfFieldTool | 03fedb4453a1e8498362c4732ce2b953db1cd718 | [
"MIT"
] | null | null | null | """Requires Python 3"""
# General imports
import os, sys, shutil
# Third-Party imports
from PySide2 import QtCore
import maya.cmds as cmds
from maya.app.startup import basic
import maya.utils
# Base path definitions
MODULENAME = "depthOfFieldTool"
DRAGGEDFROMPATH = os.path.dirname(__file__)
DEFAULTMODULEPATH = f"... | 31.514286 | 89 | 0.758386 |
import os, sys, shutil
from PySide2 import QtCore
import maya.cmds as cmds
from maya.app.startup import basic
import maya.utils
MODULENAME = "depthOfFieldTool"
DRAGGEDFROMPATH = os.path.dirname(__file__)
DEFAULTMODULEPATH = f"{os.environ['MAYA_APP_DIR']}/modules"
DEFAULTSCRIPTSPATH = f"{os.environ['MAYA_APP_DIR... | true | true |
f740c6a07c8be7341061360434fe1031f96d942f | 1,436 | py | Python | libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_request_body.py | Fl4v/botbuilder-python | 4003d713beb8fb986a01cfd11632eabc65858618 | [
"MIT"
] | 388 | 2019-05-07T15:53:21.000Z | 2022-03-28T20:29:46.000Z | libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_request_body.py | Fl4v/botbuilder-python | 4003d713beb8fb986a01cfd11632eabc65858618 | [
"MIT"
] | 1,286 | 2019-05-07T23:38:19.000Z | 2022-03-31T10:44:16.000Z | libraries/botbuilder-adapters-slack/botbuilder/adapters/slack/slack_request_body.py | Fl4v/botbuilder-python | 4003d713beb8fb986a01cfd11632eabc65858618 | [
"MIT"
] | 168 | 2019-05-14T20:23:25.000Z | 2022-03-16T06:49:14.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from typing import List
from botbuilder.adapters.slack.slack_event import SlackEvent
from botbuilder.adapters.slack.slack_payload import SlackPayload
class SlackRequestBody:
def __init__(self, **kwargs):
... | 37.789474 | 89 | 0.617688 |
from typing import List
from botbuilder.adapters.slack.slack_event import SlackEvent
from botbuilder.adapters.slack.slack_payload import SlackPayload
class SlackRequestBody:
def __init__(self, **kwargs):
self.challenge = kwargs.get("challenge")
self.token = kwargs.get("token")
... | true | true |
f740c6abeb60174e186fd70c792ca53c83648c0c | 7,669 | py | Python | nets/SBMs_node_classification/mo_net.py | karl-zhao/benchmarking-gnns-pyg | 23d2c823f16ead554b22ff31c41d5bd8074b133e | [
"MIT"
] | 17 | 2020-12-03T12:20:04.000Z | 2021-09-15T05:43:03.000Z | nets/SBMs_node_classification/mo_net.py | karl-zhao/benchmarking-gnns-pyg | 23d2c823f16ead554b22ff31c41d5bd8074b133e | [
"MIT"
] | null | null | null | nets/SBMs_node_classification/mo_net.py | karl-zhao/benchmarking-gnns-pyg | 23d2c823f16ead554b22ff31c41d5bd8074b133e | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
# from torch_scatter import scatter_add
# from num_nodes import maybe_num_nodes
import dgl
from torch_geometric.nn.conv import MessagePassing
import numpy as np
import torch.nn as nn
from torch import Tensor
# from torch_geometric.utils import degree
fr... | 41.231183 | 121 | 0.610771 | import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl
from torch_geometric.nn.conv import MessagePassing
import numpy as np
import torch.nn as nn
from torch import Tensor
from torch_scatter import scatter_add
from layers.gmm_layer import GMMLayer
from layers.mlp_readout_layer import MLPRead... | true | true |
f740c7e4c84cf2fefa798fe9aeebca8956782624 | 3,641 | py | Python | tensorflow_federated/python/core/impl/execution_contexts/async_execution_context_test.py | teo-milea/federated | ce0707a954a531860eb38864b44d7b748fd62aa7 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/execution_contexts/async_execution_context_test.py | teo-milea/federated | ce0707a954a531860eb38864b44d7b748fd62aa7 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/execution_contexts/async_execution_context_test.py | teo-milea/federated | ce0707a954a531860eb38864b44d7b748fd62aa7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 39.150538 | 92 | 0.773139 |
import asyncio
import numpy as np
import tensorflow as tf
from tensorflow_federated.python.core.api import computations
from tensorflow_federated.python.core.impl.context_stack import get_context_stack
from tensorflow_federated.python.core.impl.execution_contexts import async_execution_context
from tenso... | true | true |
f740c8584711d37f9423372400f599abc6cf9519 | 6,424 | py | Python | netcfgbu/config_model.py | jeremyschulman/netcfgbu | c2056f07aefa7c9e584fc9a34c9971100df7fa49 | [
"Apache-2.0"
] | 83 | 2020-06-02T13:25:33.000Z | 2022-03-07T20:50:36.000Z | netcfgbu/config_model.py | jeremyschulman/netcfgbu | c2056f07aefa7c9e584fc9a34c9971100df7fa49 | [
"Apache-2.0"
] | 55 | 2020-06-03T17:51:31.000Z | 2021-08-14T14:13:56.000Z | netcfgbu/config_model.py | jeremyschulman/netcfgbu | c2056f07aefa7c9e584fc9a34c9971100df7fa49 | [
"Apache-2.0"
] | 16 | 2020-06-05T20:32:27.000Z | 2021-11-01T17:06:38.000Z | import re
import os
from typing import Optional, Union, List, Dict
from os.path import expandvars
from itertools import chain
from pathlib import Path
from pydantic import (
BaseModel,
SecretStr,
BaseSettings,
PositiveInt,
FilePath,
Field,
validator,
root_validator,
)
from . import co... | 28.551111 | 88 | 0.650218 | import re
import os
from typing import Optional, Union, List, Dict
from os.path import expandvars
from itertools import chain
from pathlib import Path
from pydantic import (
BaseModel,
SecretStr,
BaseSettings,
PositiveInt,
FilePath,
Field,
validator,
root_validator,
)
from . import co... | true | true |
f740c8bf589ff3e844fb2a23581fe799de66a8ac | 4,267 | py | Python | openmdao/matrices/dense_matrix.py | naylor-b/blue | d7d7e8d63212c047a7a9b0625da98aa29ddc39b4 | [
"Apache-2.0"
] | 1 | 2016-05-10T17:01:17.000Z | 2016-05-10T17:01:17.000Z | openmdao/matrices/dense_matrix.py | gsoxley/OpenMDAO | 709401e535cf6933215abd942d4b4d49dbf61b2b | [
"Apache-2.0"
] | 3 | 2016-05-10T16:55:46.000Z | 2018-10-22T23:28:52.000Z | openmdao/matrices/dense_matrix.py | gsoxley/OpenMDAO | 709401e535cf6933215abd942d4b4d49dbf61b2b | [
"Apache-2.0"
] | 2 | 2018-04-05T15:53:54.000Z | 2018-10-22T22:48:00.000Z | """Define the DenseMatrix class."""
from __future__ import division, print_function
import numpy as np
from numpy import ndarray
from six import iteritems
from scipy.sparse import coo_matrix
from openmdao.matrices.coo_matrix import COOMatrix
# NOTE: DenseMatrix is inherited from COOMatrix so that we can easily handl... | 32.572519 | 89 | 0.572065 | from __future__ import division, print_function
import numpy as np
from numpy import ndarray
from six import iteritems
from scipy.sparse import coo_matrix
from openmdao.matrices.coo_matrix import COOMatrix
class DenseMatrix(COOMatrix):
def _build(self, num_rows, num_cols, in_ranges, out_ranges):
s... | true | true |
f740c91a26d7812d713fe4bf1a9ef2d9bfcffa43 | 6,968 | py | Python | rc/models/drqa.py | WERimagin/baseline_CoQA | d11d19283b4c9b9b15cfcdb96bf5cd262bb953e8 | [
"MIT"
] | null | null | null | rc/models/drqa.py | WERimagin/baseline_CoQA | d11d19283b4c9b9b15cfcdb96bf5cd262bb953e8 | [
"MIT"
] | null | null | null | rc/models/drqa.py | WERimagin/baseline_CoQA | d11d19283b4c9b9b15cfcdb96bf5cd262bb953e8 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from .layers import SeqAttnMatch, StackedBRNN, LinearSeqAttn, BilinearSeqAttn
from .layers import weighted_avg, uniform_weights, dropout
class DrQA(nn.Module):
"""Network for the Document Reader module of DrQA."""
_RNN_TYPES = {'lstm': nn.LSTM... | 43.823899 | 117 | 0.630454 | import torch
import torch.nn as nn
import torch.nn.functional as F
from .layers import SeqAttnMatch, StackedBRNN, LinearSeqAttn, BilinearSeqAttn
from .layers import weighted_avg, uniform_weights, dropout
class DrQA(nn.Module):
_RNN_TYPES = {'lstm': nn.LSTM, 'gru': nn.GRU, 'rnn': nn.RNN}
def __init__(self, co... | true | true |
f740c92f0e4de229327eb38592e11853a396d312 | 880 | py | Python | tests/test_Signing.py | christophevg/py-mqfactory | 6681fea96efe6985f6dc8631cb96eb48c43146dd | [
"MIT"
] | null | null | null | tests/test_Signing.py | christophevg/py-mqfactory | 6681fea96efe6985f6dc8631cb96eb48c43146dd | [
"MIT"
] | 4 | 2020-03-24T16:51:35.000Z | 2021-06-01T23:37:00.000Z | tests/test_Signing.py | christophevg/py-mqfactory | 6681fea96efe6985f6dc8631cb96eb48c43146dd | [
"MIT"
] | null | null | null | from mqfactory import Message
from mqfactory.message.security import Signing, Signature
from mqfactory.tools import Policy, Rule
def test_signing_setup(mq, transport, signature):
Signing( mq, adding=signature )
mq.before_sending.append.assert_called_with(signature.sign)
mq.before_han... | 31.428571 | 66 | 0.744318 | from mqfactory import Message
from mqfactory.message.security import Signing, Signature
from mqfactory.tools import Policy, Rule
def test_signing_setup(mq, transport, signature):
Signing( mq, adding=signature )
mq.before_sending.append.assert_called_with(signature.sign)
mq.before_han... | true | true |
f740c935f94c34d5854ef8e7c113a605e9699a93 | 7,153 | py | Python | eu.modelwriter.smtlib.texteditor/lib/z3-4.8.4/win/python/z3/z3consts.py | ModelWriter/smtlib-tool | b075a8b6bf6188134a50f3884aad480d468fe558 | [
"MIT"
] | null | null | null | eu.modelwriter.smtlib.texteditor/lib/z3-4.8.4/win/python/z3/z3consts.py | ModelWriter/smtlib-tool | b075a8b6bf6188134a50f3884aad480d468fe558 | [
"MIT"
] | null | null | null | eu.modelwriter.smtlib.texteditor/lib/z3-4.8.4/win/python/z3/z3consts.py | ModelWriter/smtlib-tool | b075a8b6bf6188134a50f3884aad480d468fe558 | [
"MIT"
] | null | null | null | # Automatically generated file
# enum Z3_lbool
Z3_L_FALSE = -1
Z3_L_UNDEF = 0
Z3_L_TRUE = 1
# enum Z3_symbol_kind
Z3_INT_SYMBOL = 0
Z3_STRING_SYMBOL = 1
# enum Z3_parameter_kind
Z3_PARAMETER_INT = 0
Z3_PARAMETER_DOUBLE = 1
Z3_PARAMETER_RATIONAL = 2
Z3_PARAMETER_SYMBOL = 3
Z3_PARAMETER_SORT = 4
Z3_PA... | 22.214286 | 41 | 0.779952 |
Z3_L_FALSE = -1
Z3_L_UNDEF = 0
Z3_L_TRUE = 1
Z3_INT_SYMBOL = 0
Z3_STRING_SYMBOL = 1
Z3_PARAMETER_INT = 0
Z3_PARAMETER_DOUBLE = 1
Z3_PARAMETER_RATIONAL = 2
Z3_PARAMETER_SYMBOL = 3
Z3_PARAMETER_SORT = 4
Z3_PARAMETER_AST = 5
Z3_PARAMETER_FUNC_DECL = 6
Z3_UNINTERPRETED_SORT = 0
Z3_BOOL_SORT = 1
Z... | true | true |
f740c9986dc746cfac8baa40badc2ab15f62282e | 3,803 | py | Python | 875-domain.py | wpliao19/test | c6af60b3a7112fc54994e8fb550e2d54fbdc48ab | [
"Apache-2.0"
] | null | null | null | 875-domain.py | wpliao19/test | c6af60b3a7112fc54994e8fb550e2d54fbdc48ab | [
"Apache-2.0"
] | 1 | 2022-01-17T03:05:33.000Z | 2022-01-17T03:05:53.000Z | 875-domain.py | wpliao19/test | c6af60b3a7112fc54994e8fb550e2d54fbdc48ab | [
"Apache-2.0"
] | null | null | null | #!/bin/python3
# -*- coding:utf-8 -*-
# CTX Engine-874 : IP
# 1、查询ip样本 2、查看查询结�?# 2、返回正确的ioc信息
from maldium import *
import ctypes
def print_result(result, extra_res):
if result is None:
print("query failed")
return
if result.eMatchType == engine.NO_MATCH:
print("result NO_MATCH")
... | 34.889908 | 400 | 0.677097 |
import *
import ctypes
def print_result(result, extra_res):
if result is None:
print("query failed")
return
if result.eMatchType == engine.NO_MATCH:
print("result NO_MATCH")
return
elif result.eMatchType == engine.LOCAL_PTN_MATCHED:
match_type = "LOCAL_PTN_MATC... | true | true |
f740cb07c4339f7ad2f9b477c54d3426f808f79d | 33,661 | py | Python | src/saml2/client_base.py | openstack/deb-python-pysaml2 | c54db131dd2c54b18bdc300ba7fdf3b08e68f07c | [
"Apache-2.0"
] | 13 | 2016-09-14T21:59:45.000Z | 2019-04-01T12:16:19.000Z | src/saml2/client_base.py | openstack/deb-python-pysaml2 | c54db131dd2c54b18bdc300ba7fdf3b08e68f07c | [
"Apache-2.0"
] | null | null | null | src/saml2/client_base.py | openstack/deb-python-pysaml2 | c54db131dd2c54b18bdc300ba7fdf3b08e68f07c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
"""Contains classes and functions that a SAML2.0 Service Provider (SP) may use
to conclude its tasks.
"""
import threading
import six
from saml2.entity import Entity
from saml2.mdstore import destinations
from saml2.profile import paos, ecp
from saml2.saml import NAMEI... | 39.140698 | 89 | 0.569116 |
import threading
import six
from saml2.entity import Entity
from saml2.mdstore import destinations
from saml2.profile import paos, ecp
from saml2.saml import NAMEID_FORMAT_TRANSIENT
from saml2.samlp import AuthnQuery, RequestedAuthnContext
from saml2.samlp import NameIDMappingRequest
from saml2.samlp import Attri... | true | true |
f740cbe94b9e66e8318cfcdb61f496681bcfc403 | 188 | py | Python | Exercices/Secao04/exercicio18.py | Guilt-tech/PythonExercices | e59bffae997a1974d3e3cdcfff7700afbed65e6e | [
"MIT"
] | null | null | null | Exercices/Secao04/exercicio18.py | Guilt-tech/PythonExercices | e59bffae997a1974d3e3cdcfff7700afbed65e6e | [
"MIT"
] | null | null | null | Exercices/Secao04/exercicio18.py | Guilt-tech/PythonExercices | e59bffae997a1974d3e3cdcfff7700afbed65e6e | [
"MIT"
] | null | null | null | print('Digite um valor de volume em metros cúbocos, que será convertido em libras')
M = float(input('Volume: '))
L = 1000 * M
print(f'O volume em litros é: {L} e em metros cúbicos é: {M}') | 47 | 83 | 0.691489 | print('Digite um valor de volume em metros cúbocos, que será convertido em libras')
M = float(input('Volume: '))
L = 1000 * M
print(f'O volume em litros é: {L} e em metros cúbicos é: {M}') | true | true |
f740cc8ccc902f8792988edc6cdc36fe9d1d126e | 6,305 | py | Python | homeassistant/components/ifttt/alarm_control_panel.py | fuzzie360/home-assistant | 8933540950cb755b041535bd628710abb122dde5 | [
"Apache-2.0"
] | 1 | 2020-06-04T13:18:14.000Z | 2020-06-04T13:18:14.000Z | homeassistant/components/ifttt/alarm_control_panel.py | fuzzie360/home-assistant | 8933540950cb755b041535bd628710abb122dde5 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/ifttt/alarm_control_panel.py | fuzzie360/home-assistant | 8933540950cb755b041535bd628710abb122dde5 | [
"Apache-2.0"
] | null | null | null | """Support for alarm control panels that can be controlled through IFTTT."""
import logging
import re
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel import DOMAIN, PLATFORM_SCHEMA
from homeassistant.components.alarm_control_panel... | 32.333333 | 88 | 0.69548 | import logging
import re
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel import DOMAIN, PLATFORM_SCHEMA
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
S... | true | true |
f740cc9a82a23b8159257b8e2ab2019fc8c0b9f6 | 2,686 | py | Python | src/multidirmap/_read_only_dict.py | janrg/multidirmap | d056607f1e5aeb59ba8447361315748dca80c4f0 | [
"MIT"
] | 3 | 2019-10-11T14:16:59.000Z | 2019-10-16T15:40:48.000Z | src/multidirmap/_read_only_dict.py | janrg/multidirmap | d056607f1e5aeb59ba8447361315748dca80c4f0 | [
"MIT"
] | 5 | 2018-07-28T16:20:50.000Z | 2019-09-27T13:47:50.000Z | src/multidirmap/_read_only_dict.py | janrg/multidirmap | d056607f1e5aeb59ba8447361315748dca80c4f0 | [
"MIT"
] | 1 | 2021-05-20T14:35:49.000Z | 2021-05-20T14:35:49.000Z | """Thin wrapper for dict or OrderedDict providing togglable read-only.
If the Python version keeps dict entries in insertion order, dict is used,
otherwise OrderedDict.
"""
import sys
if (
sys.version_info[:3] >= (3, 6, 0) # pragma: no cover
and sys.implementation.name == "cpython"
) or sys.version_info >= ... | 30.179775 | 80 | 0.655249 |
import sys
if (
sys.version_info[:3] >= (3, 6, 0)
and sys.implementation.name == "cpython"
) or sys.version_info >= (3, 7, 0):
_dicttype = dict
else:
from collections import OrderedDict
_dicttype = OrderedDict
def if_not_read_only(f):
def wrapper(*args):
if args[0]._read_only:
... | true | true |
f740cd677e2937b8b6318a119f8a2a2e2f080a2e | 9,689 | py | Python | tests/wallet/sync/test_wallet_sync.py | grayfallstown/scam-blockchain | 2183020cc74bbd1a63dda6eb0d0e73c2a3429594 | [
"Apache-2.0"
] | 12 | 2021-08-04T14:35:02.000Z | 2022-02-09T04:31:44.000Z | tests/wallet/sync/test_wallet_sync.py | grayfallstown/scam-blockchain | 2183020cc74bbd1a63dda6eb0d0e73c2a3429594 | [
"Apache-2.0"
] | 8 | 2021-08-04T20:58:10.000Z | 2021-09-11T17:08:28.000Z | tests/wallet/sync/test_wallet_sync.py | grayfallstown/scam-blockchain | 2183020cc74bbd1a63dda6eb0d0e73c2a3429594 | [
"Apache-2.0"
] | 4 | 2021-07-28T09:50:55.000Z | 2022-03-15T08:43:53.000Z | # flake8: noqa: F811, F401
import asyncio
import pytest
from colorlog import logging
from scam.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from scam.protocols import full_node_protocol
from scam.simulator.simulator_protocol import FarmNewBlockProtocol
from scam.types.peer_info i... | 41.583691 | 118 | 0.727732 |
import asyncio
import pytest
from colorlog import logging
from scam.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from scam.protocols import full_node_protocol
from scam.simulator.simulator_protocol import FarmNewBlockProtocol
from scam.types.peer_info import PeerInfo
from scam.u... | true | true |
f740cd70e22bf0c86f278bb82af8369e7dd267cd | 1,858 | py | Python | test/test_exceptions.py | dhrone/pyASH | 85da060d135fb8be6475d58d4dc33acf88a3a9b2 | [
"MIT"
] | null | null | null | test/test_exceptions.py | dhrone/pyASH | 85da060d135fb8be6475d58d4dc33acf88a3a9b2 | [
"MIT"
] | null | null | null | test/test_exceptions.py | dhrone/pyASH | 85da060d135fb8be6475d58d4dc33acf88a3a9b2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 by dhrone. All Rights Reserved.
#
import pytest
import json
from python_jsonschema_objects import ValidationError
from pyASH.exceptions import *
from pyASH.pyASH import pyASH
from pyASH.objects import Request
# Imports for v3 validation
import jsonschema
from jsonschema im... | 25.452055 | 87 | 0.603875 |
import pytest
import json
from python_jsonschema_objects import ValidationError
from pyASH.exceptions import *
from pyASH.pyASH import pyASH
from pyASH.objects import Request
import jsonschema
from jsonschema import validate
import json
from pyASH.validation import validate_message
@pytest.fixture
def setup(... | true | true |
f740cd7d1496c9f5a0447132a9ab1437e71c1ee8 | 4,722 | py | Python | appengine/components/components/auth/prpc.py | maruel/swarming | 8ab7568635fcbfd85a01884b64704fc2a1ac13c7 | [
"Apache-2.0"
] | 74 | 2015-04-01T02:35:15.000Z | 2021-12-17T22:10:56.000Z | appengine/components/components/auth/prpc.py | maruel/swarming | 8ab7568635fcbfd85a01884b64704fc2a1ac13c7 | [
"Apache-2.0"
] | 123 | 2015-04-01T04:02:57.000Z | 2022-03-02T12:49:55.000Z | appengine/components/components/auth/prpc.py | maruel/swarming | 8ab7568635fcbfd85a01884b64704fc2a1ac13c7 | [
"Apache-2.0"
] | 32 | 2015-04-03T01:40:47.000Z | 2021-11-13T15:20:13.000Z | # Copyright 2018 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Defines pRPC server interceptor that initializes auth context."""
import logging
from components import prpc
from . import api
from . import... | 33.020979 | 77 | 0.739094 |
import logging
from components import prpc
from . import api
from . import check
from . import config
from . import delegation
from . import ipaddr
from . import model
__all__ = ['prpc_interceptor']
def prpc_interceptor(request, context, call_details, continuation):
try:
peer_ip = _parse_rpc_peer(cont... | true | true |
f740ce1d40723cea3cf57212153bb9152264283d | 6,070 | py | Python | heat/engine/resources/openstack/ceilometer/gnocchi/alarm.py | whitepages/heat | 4da2e1262fa42e6107389ba7a0e72ade024e316f | [
"Apache-2.0"
] | null | null | null | heat/engine/resources/openstack/ceilometer/gnocchi/alarm.py | whitepages/heat | 4da2e1262fa42e6107389ba7a0e72ade024e316f | [
"Apache-2.0"
] | null | null | null | heat/engine/resources/openstack/ceilometer/gnocchi/alarm.py | whitepages/heat | 4da2e1262fa42e6107389ba7a0e72ade024e316f | [
"Apache-2.0"
] | 1 | 2021-03-21T11:37:03.000Z | 2021-03-21T11:37:03.000Z | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 31.614583 | 79 | 0.658155 |
from heat.common.i18n import _
from heat.engine import constraints
from heat.engine import properties
from heat.engine.resources.openstack.ceilometer import alarm
from heat.engine import support
COMMON_GNOCCHI_PROPERTIES = (
COMPARISON_OPERATOR, EVALUATION_PERIODS, GRANULARITY,
AGGREGATION_METHO... | true | true |
f740ce378e2f71daeee1212a841c70ec2a37a4a4 | 800 | py | Python | python/SqlParser/config_create.py | DataHandwerk/DataHandwerk-toolkit-mssql | 0225d7f3a6c12041c81c932cc97c8dee40c9c658 | [
"MIT"
] | 1 | 2021-01-14T07:13:39.000Z | 2021-01-14T07:13:39.000Z | python/SqlParser/config_create.py | DataHandwerk/DataHandwerk-toolkit-mssql | 0225d7f3a6c12041c81c932cc97c8dee40c9c658 | [
"MIT"
] | null | null | null | python/SqlParser/config_create.py | DataHandwerk/DataHandwerk-toolkit-mssql | 0225d7f3a6c12041c81c932cc97c8dee40c9c658 | [
"MIT"
] | null | null | null | #execute
#py config_create.py
import configparser
config = configparser.ConfigParser()
config['mssql'] = {}
config['mssql']['server'] = 'localhost\sql2019'
config['mssql']['database'] = 'dhw_PerformanceAnalytics'
# mssql = config['mssql']
# mssql['server'] = 'localhost\sql2019'
# config['DEFAULT'] = {'ServerAliveIn... | 30.769231 | 56 | 0.63625 |
import configparser
config = configparser.ConfigParser()
config['mssql'] = {}
config['mssql']['server'] = 'localhost\sql2019'
config['mssql']['database'] = 'dhw_PerformanceAnalytics'
'w') as configfile:
config.write(configfile) | true | true |
f740ce69f54e0e79275c16eed57d65a3603fe695 | 1,023 | py | Python | examples/volumetric/slicePlane1.py | charliekind/vtkplotter | e16daac258dc0b383043575f2916ac4ea84a60b1 | [
"MIT"
] | null | null | null | examples/volumetric/slicePlane1.py | charliekind/vtkplotter | e16daac258dc0b383043575f2916ac4ea84a60b1 | [
"MIT"
] | null | null | null | examples/volumetric/slicePlane1.py | charliekind/vtkplotter | e16daac258dc0b383043575f2916ac4ea84a60b1 | [
"MIT"
] | null | null | null | """Slice a Volume with an arbitrary plane
hover the plane to get the scalar values"""
from vedo import *
vol = Volume(dataurl+'embryo.slc').alpha([0,0,0.8]).c('w').pickable(False)
sl = vol.slicePlane(origin=vol.center(), normal=(0,1,1))
sl.cmap('Purples_r').lighting('off').addScalarBar(title='Slice', c='w')
arr = sl.... | 42.625 | 77 | 0.679374 | from vedo import *
vol = Volume(dataurl+'embryo.slc').alpha([0,0,0.8]).c('w').pickable(False)
sl = vol.slicePlane(origin=vol.center(), normal=(0,1,1))
sl.cmap('Purples_r').lighting('off').addScalarBar(title='Slice', c='w')
arr = sl.pointdata[0]
def func(evt):
if not evt.actor:
return
pid = evt.actor... | true | true |
f740cef1c3f314ddaf4f469899de7f596a8048b7 | 152 | py | Python | django_chat/chat/admin.py | ugauniyal/Real-Time-Chat | 1c5f44f0cd53a5c65cbf3c9cd8c5af0f9b96475a | [
"MIT"
] | null | null | null | django_chat/chat/admin.py | ugauniyal/Real-Time-Chat | 1c5f44f0cd53a5c65cbf3c9cd8c5af0f9b96475a | [
"MIT"
] | null | null | null | django_chat/chat/admin.py | ugauniyal/Real-Time-Chat | 1c5f44f0cd53a5c65cbf3c9cd8c5af0f9b96475a | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Room, Message
# Register your models here.
admin.site.register(Room)
admin.site.register(Message) | 21.714286 | 33 | 0.802632 | from django.contrib import admin
from .models import Room, Message
admin.site.register(Room)
admin.site.register(Message) | true | true |
f740cf4557b3025e6483dbb0e6153220c2507168 | 3,517 | py | Python | bindings/python/ensmallen/datasets/string/blastomycesdermatitidiser3.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/blastomycesdermatitidiser3.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/blastomycesdermatitidiser3.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Blastomyces dermatitidis ER-3.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--... | 33.495238 | 223 | 0.680125 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def BlastomycesDermatitidisEr3(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graph... | true | true |
f740cf81d062d58dcfa65d8771df1edbc97c41b4 | 1,358 | py | Python | haiku_baselines/TD3/network.py | TinkTheBoush/haiku-baseline | d7c6d270ba3b861e49e4d4d19d057706bcb384ea | [
"MIT"
] | null | null | null | haiku_baselines/TD3/network.py | TinkTheBoush/haiku-baseline | d7c6d270ba3b861e49e4d4d19d057706bcb384ea | [
"MIT"
] | null | null | null | haiku_baselines/TD3/network.py | TinkTheBoush/haiku-baseline | d7c6d270ba3b861e49e4d4d19d057706bcb384ea | [
"MIT"
] | null | null | null | import numpy as np
import haiku as hk
import jax
import jax.numpy as jnp
class Actor(hk.Module):
def __init__(self,action_size,node=256,hidden_n=2):
super(Actor, self).__init__()
self.action_size = action_size
self.node = node
self.hidden_n = hidden_n
self.layer = hk.Linear... | 30.863636 | 102 | 0.522828 | import numpy as np
import haiku as hk
import jax
import jax.numpy as jnp
class Actor(hk.Module):
def __init__(self,action_size,node=256,hidden_n=2):
super(Actor, self).__init__()
self.action_size = action_size
self.node = node
self.hidden_n = hidden_n
self.layer = hk.Linear... | true | true |
f740cffcec0a250513a875beff9dbe87da6c3915 | 507 | py | Python | openchem/layers/ipd.py | YNYuan/OpenChem | 4364af6d92ae183aac0bea35726d7ae0ee518920 | [
"MIT"
] | null | null | null | openchem/layers/ipd.py | YNYuan/OpenChem | 4364af6d92ae183aac0bea35726d7ae0ee518920 | [
"MIT"
] | null | null | null | openchem/layers/ipd.py | YNYuan/OpenChem | 4364af6d92ae183aac0bea35726d7ae0ee518920 | [
"MIT"
] | null | null | null | # modified from https://github.com/tkipf/gae/blob/master/gae/layers.py
import torch
import torch.nn as nn
class InnerProductDecoder(nn.Module):
"""Decoder model layer for link prediction."""
def __init__(self, input_dim, act=nn.functional.sigmoid):
super(InnerProductDecoder, self).__init__()
s... | 29.823529 | 70 | 0.648915 |
import torch
import torch.nn as nn
class InnerProductDecoder(nn.Module):
def __init__(self, input_dim, act=nn.functional.sigmoid):
super(InnerProductDecoder, self).__init__()
self.act = act
def forward(self, inputs):
x = inputs.transpose(1,2)
x = torch.mm(inputs, x)
x... | true | true |
f740d04cf7676ac0b4ced8a752e25a7c21351705 | 423 | py | Python | tests/test_ValWatcher.py | TheBoringBakery/Riot-Watcher | 6e05fffe127530a75fd63e67da37ba81489fd4fe | [
"MIT"
] | 2 | 2020-10-06T23:33:01.000Z | 2020-11-22T01:58:43.000Z | tests/test_ValWatcher.py | TheBoringBakery/Riot-Watcher | 6e05fffe127530a75fd63e67da37ba81489fd4fe | [
"MIT"
] | null | null | null | tests/test_ValWatcher.py | TheBoringBakery/Riot-Watcher | 6e05fffe127530a75fd63e67da37ba81489fd4fe | [
"MIT"
] | null | null | null | import pytest
from riotwatcher import ValWatcher
@pytest.mark.val
@pytest.mark.usefixtures("reset_globals")
class TestValWatcher:
def test_require_api_key(self):
with pytest.raises(ValueError):
ValWatcher(None)
def test_allows_positional_api_key(self):
ValWatcher("RGAPI-this-is-a... | 23.5 | 50 | 0.723404 | import pytest
from riotwatcher import ValWatcher
@pytest.mark.val
@pytest.mark.usefixtures("reset_globals")
class TestValWatcher:
def test_require_api_key(self):
with pytest.raises(ValueError):
ValWatcher(None)
def test_allows_positional_api_key(self):
ValWatcher("RGAPI-this-is-a... | true | true |
f740d29865b29eaf97a7bc6fbdf1d048c6b3318e | 2,143 | py | Python | server.py | krustea/surlejaune | 14d05c657a13cc4b4882538803d8c21fc57573ae | [
"MIT"
] | null | null | null | server.py | krustea/surlejaune | 14d05c657a13cc4b4882538803d8c21fc57573ae | [
"MIT"
] | null | null | null | server.py | krustea/surlejaune | 14d05c657a13cc4b4882538803d8c21fc57573ae | [
"MIT"
] | null | null | null | from flask import Flask
from temperature import TemperatureSensor
from flask_socketio import SocketIO, send, emit
from flask import render_template
import time
import threading
import RPi.GPIO as GPIO
app = Flask(__name__)
degcel = TemperatureSensor()
socketio = SocketIO(app)
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(Fa... | 31.514706 | 107 | 0.653756 | from flask import Flask
from temperature import TemperatureSensor
from flask_socketio import SocketIO, send, emit
from flask import render_template
import time
import threading
import RPi.GPIO as GPIO
app = Flask(__name__)
degcel = TemperatureSensor()
socketio = SocketIO(app)
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(Fa... | true | true |
f740d2cd3ecefc7c7524e194ab2a9b7856d1672c | 8,038 | py | Python | modules/dials/test/command_line/test_reindex.py | jorgediazjr/dials-dev20191018 | 77d66c719b5746f37af51ad593e2941ed6fbba17 | [
"BSD-3-Clause"
] | null | null | null | modules/dials/test/command_line/test_reindex.py | jorgediazjr/dials-dev20191018 | 77d66c719b5746f37af51ad593e2941ed6fbba17 | [
"BSD-3-Clause"
] | null | null | null | modules/dials/test/command_line/test_reindex.py | jorgediazjr/dials-dev20191018 | 77d66c719b5746f37af51ad593e2941ed6fbba17 | [
"BSD-3-Clause"
] | 1 | 2020-02-04T15:39:06.000Z | 2020-02-04T15:39:06.000Z | from __future__ import absolute_import, division, print_function
import os
import procrunner
import pytest
import six
from cctbx import sgtbx
from dxtbx.serialize import load
from six.moves import cPickle as pickle
def pickle_loads(data):
if six.PY3:
return pickle.loads(data, encoding="bytes")
else:... | 37.915094 | 86 | 0.681388 | from __future__ import absolute_import, division, print_function
import os
import procrunner
import pytest
import six
from cctbx import sgtbx
from dxtbx.serialize import load
from six.moves import cPickle as pickle
def pickle_loads(data):
if six.PY3:
return pickle.loads(data, encoding="bytes")
else:... | true | true |
f740d3fc811b90c584a56c98611b71a5ab7ebbc9 | 171 | py | Python | user/vistas/widgets/test/test.py | ZerpaTechnology/occoa | a8c0bd2657bc058801a883109c0ec0d608d04ccc | [
"Apache-2.0"
] | null | null | null | user/vistas/widgets/test/test.py | ZerpaTechnology/occoa | a8c0bd2657bc058801a883109c0ec0d608d04ccc | [
"Apache-2.0"
] | null | null | null | user/vistas/widgets/test/test.py | ZerpaTechnology/occoa | a8c0bd2657bc058801a883109c0ec0d608d04ccc | [
"Apache-2.0"
] | null | null | null | doc+='''<script type="text/javascript" src="'''
try: doc+=str(routes.widget_base_url)
except Exception as e: doc+=str(e)
doc+='''/__javascript__/bootstrap.js"></script>''' | 42.75 | 50 | 0.695906 | doc+='''<script type="text/javascript" src="'''
try: doc+=str(routes.widget_base_url)
except Exception as e: doc+=str(e)
doc+='''/__javascript__/bootstrap.js"></script>''' | true | true |
f740d48eda3c8c07e9e9b798be1ed808dd2b0709 | 399 | py | Python | intents/helpers/misc.py | dario-chiappetta/dialogflow_agents | ecb03bdce491a3c9d6769816507f3027fd5a60d1 | [
"Apache-2.0"
] | 6 | 2021-06-24T12:22:21.000Z | 2021-07-21T21:06:19.000Z | intents/helpers/misc.py | dario-chiappetta/dialogflow_agents | ecb03bdce491a3c9d6769816507f3027fd5a60d1 | [
"Apache-2.0"
] | 27 | 2021-06-05T10:41:08.000Z | 2021-11-01T17:29:38.000Z | intents/helpers/misc.py | dariowho/intents | ecb03bdce491a3c9d6769816507f3027fd5a60d1 | [
"Apache-2.0"
] | null | null | null | import re
def camel_to_snake_case(name: str) -> str:
"""
Source: https://stackoverflow.com/a/1176023
Args:
name: A CamelCase name
Returns:
A snake_case version of the input name
"""
name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
name = re.sub('__([A-Z])', r'_\1', name)
... | 23.470588 | 54 | 0.538847 | import re
def camel_to_snake_case(name: str) -> str:
name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
name = re.sub('__([A-Z])', r'_\1', name)
name = re.sub('([a-z0-9])([A-Z])', r'\1_\2', name)
return name.lower()
| true | true |
f740d4af7e4f1e2052957ba3a03a534a94d543b5 | 821 | py | Python | Technical-Interview/Searching-and-Sorting/recursion_practice.py | debugtalk/MyUdacity | 3e27cab31260b8ae32e8e37773f2536da3853a57 | [
"MIT"
] | null | null | null | Technical-Interview/Searching-and-Sorting/recursion_practice.py | debugtalk/MyUdacity | 3e27cab31260b8ae32e8e37773f2536da3853a57 | [
"MIT"
] | null | null | null | Technical-Interview/Searching-and-Sorting/recursion_practice.py | debugtalk/MyUdacity | 3e27cab31260b8ae32e8e37773f2536da3853a57 | [
"MIT"
] | null | null | null | """Implement a function recursivly to get the desired
Fibonacci sequence value.
Your code should have the same input/output as the
iterative code in the instructions."""
compute_mapping = {}
def get_fib(position):
if position in compute_mapping:
return compute_mapping[position]
if position <= 1:
... | 24.147059 | 62 | 0.682095 |
compute_mapping = {}
def get_fib(position):
if position in compute_mapping:
return compute_mapping[position]
if position <= 1:
compute_mapping[position] = position
return position
else:
result = get_fib(position - 1) + get_fib(position - 2)
compute_mapping[positio... | true | true |
f740d534aad0057a6d5f7ca8815ff3d1098ea1f4 | 1,651 | py | Python | horizon/conf/default.py | wilk/horizon | bdf7e692227367a928325acdd31088971d3c4ff4 | [
"Apache-2.0"
] | 1 | 2019-08-07T08:46:03.000Z | 2019-08-07T08:46:03.000Z | horizon/conf/default.py | wilk/horizon | bdf7e692227367a928325acdd31088971d3c4ff4 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | horizon/conf/default.py | wilk/horizon | bdf7e692227367a928325acdd31088971d3c4ff4 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 32.372549 | 75 | 0.688674 |
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
HORIZON_CONFIG = {
'dashboards': None,
'default_dashboard': None,
'user_home': settings.LOGIN_REDIRECT_URL,
# AJAX settings for JavaScript
'ajax_queue_limit': 10,
'ajax_poll_i... | true | true |
f740d586bf758684ed5af24806cf2a09d3c5ce30 | 15,150 | py | Python | heat/tests/openstack/neutron/test_qos.py | odmanV2/heat | 76c20f1fc94a06ce5a00730c50952efe19ed0e3e | [
"Apache-2.0"
] | null | null | null | heat/tests/openstack/neutron/test_qos.py | odmanV2/heat | 76c20f1fc94a06ce5a00730c50952efe19ed0e3e | [
"Apache-2.0"
] | null | null | null | heat/tests/openstack/neutron/test_qos.py | odmanV2/heat | 76c20f1fc94a06ce5a00730c50952efe19ed0e3e | [
"Apache-2.0"
] | null | null | null | #
# 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
# ... | 38.35443 | 79 | 0.650363 |
import mock
from heat.common import template_format
from heat.engine.clients.os import neutron
from heat.engine import rsrc_defn
from heat.engine import stack
from heat.engine import template
from heat.tests import common
from heat.tests import utils
qos_policy_template = '''
heat_template_version: 2016-... | true | true |
f740d587cb0fa254954388a6279fc67f970ea52f | 10,091 | py | Python | source_code/pypeflow/utils/pump_curve.py | TomLXXVI/pypeflow | 49e42621180ec3125afa238d3ca56ae9f3a7662a | [
"MIT"
] | 4 | 2020-05-26T01:11:08.000Z | 2021-09-15T20:24:31.000Z | source_code/pypeflow/utils/pump_curve.py | robertspark/pypeflow | 49e42621180ec3125afa238d3ca56ae9f3a7662a | [
"MIT"
] | null | null | null | source_code/pypeflow/utils/pump_curve.py | robertspark/pypeflow | 49e42621180ec3125afa238d3ca56ae9f3a7662a | [
"MIT"
] | 1 | 2022-01-19T20:26:11.000Z | 2022-01-19T20:26:11.000Z | """
## Pump curve fitting and drawing
- Establish an equation for the pump curve from measured points on the curve in the pump's data sheet
- Get the coefficients of the 2nd order polynomial describing the pump curve and determined via curve fitting
- Draw the pump curve in a diagram
"""
from typing import List, Tupl... | 42.221757 | 118 | 0.591418 | from typing import List, Tuple, Dict, Optional
import numpy as np
import quantities as qty
from nummath.interpolation import PolyFit
from nummath.graphing2 import LineGraph
class PumpCurve:
def __init__(self, dest_units: Dict[str, str]):
self._meas_points: List[Tuple[qty.VolumeFlowRate, qty.Pressure]] = ... | true | true |
f740d5a6c8c68955227b1c3da87d7490a4772e8b | 281 | py | Python | python/hello.py | jspc/hello-world-so | 619e25608235ea33e32dc9f20dda6aa77b1f119a | [
"MIT"
] | null | null | null | python/hello.py | jspc/hello-world-so | 619e25608235ea33e32dc9f20dda6aa77b1f119a | [
"MIT"
] | null | null | null | python/hello.py | jspc/hello-world-so | 619e25608235ea33e32dc9f20dda6aa77b1f119a | [
"MIT"
] | null | null | null | import ctypes
import os
lib_path = os.path.join(os.path.dirname(__file__), '..', 'strings.so')
lib = ctypes.CDLL(lib_path)
hello = lib.C_Hello
hello.argtype = ctypes.c_int
hello.restype = ctypes.c_char_p
print("Running from python")
print(lib.C_Hello(0))
print(lib.C_Hello(1))
| 18.733333 | 70 | 0.736655 | import ctypes
import os
lib_path = os.path.join(os.path.dirname(__file__), '..', 'strings.so')
lib = ctypes.CDLL(lib_path)
hello = lib.C_Hello
hello.argtype = ctypes.c_int
hello.restype = ctypes.c_char_p
print("Running from python")
print(lib.C_Hello(0))
print(lib.C_Hello(1))
| true | true |
f740d5f3a2d2c9cc9cda97c2ca1c2e1596a6bee0 | 441 | py | Python | data_dict.py | EnginKosure/CustomerChurnPredictionModel | 4ff67778653809c02b27727b8e375985ec17b826 | [
"MIT"
] | null | null | null | data_dict.py | EnginKosure/CustomerChurnPredictionModel | 4ff67778653809c02b27727b8e375985ec17b826 | [
"MIT"
] | 5 | 2021-01-13T22:38:13.000Z | 2021-01-14T08:26:50.000Z | data_dict.py | EnginKosure/CustomerChurnPredictionModel | 4ff67778653809c02b27727b8e375985ec17b826 | [
"MIT"
] | null | null | null | findings = {
'a': 'AutoML and high-code model trials return almost the same output',
'b': 'AutoML makes data-cleaning and feature selection implicitly',
'c': 'Quality and relevance of the data is the main determinant',
'd': 'Consuming the model via web interface could provide a better UX',
'p': 'is ... | 49 | 75 | 0.69161 | findings = {
'a': 'AutoML and high-code model trials return almost the same output',
'b': 'AutoML makes data-cleaning and feature selection implicitly',
'c': 'Quality and relevance of the data is the main determinant',
'd': 'Consuming the model via web interface could provide a better UX',
'p': 'is ... | true | true |
f740d7d8967ee0abe39c4aa4fb48a83cb44ce30e | 1,259 | py | Python | haziris/datatables/datatables.py | haziris/haziris-python | c078b6bc73187ba1cfa24b3dbcf7979a6d17e9c2 | [
"BSD-3-Clause"
] | 1 | 2020-08-27T06:25:58.000Z | 2020-08-27T06:25:58.000Z | haziris/datatables/datatables.py | haziris/haziris-python | c078b6bc73187ba1cfa24b3dbcf7979a6d17e9c2 | [
"BSD-3-Clause"
] | null | null | null | haziris/datatables/datatables.py | haziris/haziris-python | c078b6bc73187ba1cfa24b3dbcf7979a6d17e9c2 | [
"BSD-3-Clause"
] | null | null | null | import json
DATATABLES_HTML = """
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Haziris: Datatable</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css">
<style>
#haziris-datatables{
padding:5%;
}
#hazi... | 22.482143 | 113 | 0.620334 | import json
DATATABLES_HTML = """
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Haziris: Datatable</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css">
<style>
#haziris-datatables{
padding:5%;
}
#hazi... | true | true |
f740d8c67e8bfbd5625c41eff9bceca0be2e87c7 | 4,640 | py | Python | sinergym/utils/controllers.py | jajimer/sinergym | 685bcb3cda8095eef1add2b5d12e0ce102efefe9 | [
"MIT"
] | 23 | 2021-10-30T15:42:24.000Z | 2022-03-29T13:27:39.000Z | sinergym/utils/controllers.py | jajimer/sinergym | 685bcb3cda8095eef1add2b5d12e0ce102efefe9 | [
"MIT"
] | 93 | 2021-09-30T09:05:31.000Z | 2022-03-31T18:11:57.000Z | sinergym/utils/controllers.py | jajimer/sinergym | 685bcb3cda8095eef1add2b5d12e0ce102efefe9 | [
"MIT"
] | 7 | 2021-11-24T10:28:42.000Z | 2022-03-04T14:11:29.000Z | """Implementation of basic controllers."""
from datetime import datetime
from typing import Any, List, Sequence
from ..utils.common import parse_variables
class RandomController(object):
def __init__(self, env: Any):
"""Random agent. It selects available actions randomly.
Args:
env ... | 33.623188 | 108 | 0.648922 | from datetime import datetime
from typing import Any, List, Sequence
from ..utils.common import parse_variables
class RandomController(object):
def __init__(self, env: Any):
self.env = env
def act(self) -> Sequence[Any]:
action = self.env.action_space.sample()
return action
class ... | true | true |
f740d9f4c502108231d85ed13faca3b33e41e085 | 4,825 | py | Python | .cmake-format.py | dkavolis/imgui_vulkan | de1ef85a748d474a385d250ad946c230629c8e15 | [
"MIT"
] | null | null | null | .cmake-format.py | dkavolis/imgui_vulkan | de1ef85a748d474a385d250ad946c230629c8e15 | [
"MIT"
] | null | null | null | .cmake-format.py | dkavolis/imgui_vulkan | de1ef85a748d474a385d250ad946c230629c8e15 | [
"MIT"
] | null | null | null | # --------------------------
# General Formatting Options
# --------------------------
# How wide to allow formatted cmake files
line_width = 120
# How many spaces to tab for indent
tab_size = 2
# If an argument group contains more than this many sub-groups (parg or kwarg
# groups), then force it to a verti... | 30.929487 | 81 | 0.681451 |
line_width = 120
tab_size = 2
max_subgroups_hwrap = 4
max_pargs_hwrap = 6
separate_ctrl_name_with_space = False
separate_fn_name_with_space = False
dangle_parens = False
# If the trailing parenthesis must be 'dangled' on it's on line, then align it
dangle_align = 'prefix'
min_pr... | true | true |
f740da48de7aabf822e247b8ed215fb20ccb98b7 | 581 | py | Python | strings.py | widodom/hello-world | 95a9e650b89bae2c2cd40fec82aff97a778bab6f | [
"MIT"
] | null | null | null | strings.py | widodom/hello-world | 95a9e650b89bae2c2cd40fec82aff97a778bab6f | [
"MIT"
] | null | null | null | strings.py | widodom/hello-world | 95a9e650b89bae2c2cd40fec82aff97a778bab6f | [
"MIT"
] | null | null | null |
name = input('enter your name: ')
age = input('enter your age: ')
print('My name is %s and I am %s years old' % (name, age))
print('My name is {} and I am {} years old'.format(name, age))
print('My name is {name} and I am {age} years old'.format(age=99, name='Ryan'))
# This last one is more fancy than most people us... | 29.05 | 79 | 0.648881 |
name = input('enter your name: ')
age = input('enter your age: ')
print('My name is %s and I am %s years old' % (name, age))
print('My name is {} and I am {} years old'.format(name, age))
print('My name is {name} and I am {age} years old'.format(age=99, name='Ryan'))
my_info = {
'name': 'Ryan',
'age': 99,
... | true | true |
f740db0c0787cdce6493ee2dfb23fc20fc6451a3 | 9,135 | py | Python | closed/Lenovo/code/common/__init__.py | ctuning/inference_results_v1.1 | d9176eca28fcf6d7a05ccb97994362a76a1eb5ab | [
"Apache-2.0"
] | 12 | 2021-09-23T08:05:57.000Z | 2022-03-21T03:52:11.000Z | closed/Lenovo/code/common/__init__.py | ctuning/inference_results_v1.1 | d9176eca28fcf6d7a05ccb97994362a76a1eb5ab | [
"Apache-2.0"
] | 11 | 2021-09-23T20:34:06.000Z | 2022-01-22T07:58:02.000Z | closed/Lenovo/code/common/__init__.py | ctuning/inference_results_v1.1 | d9176eca28fcf6d7a05ccb97994362a76a1eb5ab | [
"Apache-2.0"
] | 16 | 2021-09-23T20:26:38.000Z | 2022-03-09T12:59:56.000Z | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.394422 | 169 | 0.627805 |
import os
import sys
sys.path.insert(0, os.getcwd())
import json
import platform
import subprocess
import sys
import re
from glob import glob
VERSION = "v1.0"
import logging
logging.basicConfig(level=logging.INFO, format="[%(asctime)s %(filename)s:%(lineno)d %(levelname)s] %(message)s")
from code.co... | true | true |
f740db2442031b09471bd9af00e8eb99c7e91017 | 382 | py | Python | cactus/full_node/signage_point.py | grayfallstown/cactus-blockchain | 680d68d0bb7694bd4b99e4906b356e014bca7734 | [
"Apache-2.0"
] | 20 | 2021-07-16T18:08:13.000Z | 2022-03-20T02:38:39.000Z | cactus/full_node/signage_point.py | grayfallstown/cactus-blockchain | 680d68d0bb7694bd4b99e4906b356e014bca7734 | [
"Apache-2.0"
] | 29 | 2021-07-17T00:38:18.000Z | 2022-03-29T19:11:48.000Z | cactus/full_node/signage_point.py | grayfallstown/cactus-blockchain | 680d68d0bb7694bd4b99e4906b356e014bca7734 | [
"Apache-2.0"
] | 21 | 2021-07-17T02:18:57.000Z | 2022-03-15T08:26:56.000Z | from dataclasses import dataclass
from typing import Optional
from cactus.types.blockchain_format.vdf import VDFInfo, VDFProof
from cactus.util.streamable import Streamable, streamable
@dataclass(frozen=True)
@streamable
class SignagePoint(Streamable):
cc_vdf: Optional[VDFInfo]
cc_proof: Optional[VDFProof]
... | 25.466667 | 64 | 0.801047 | from dataclasses import dataclass
from typing import Optional
from cactus.types.blockchain_format.vdf import VDFInfo, VDFProof
from cactus.util.streamable import Streamable, streamable
@dataclass(frozen=True)
@streamable
class SignagePoint(Streamable):
cc_vdf: Optional[VDFInfo]
cc_proof: Optional[VDFProof]
... | true | true |
f740dc306d80ceccd412592faa56a15fa47dd248 | 2,226 | py | Python | opencv/sources/modules/objdetect/misc/python/test/test_qrcode_detect.py | vrushank-agrawal/opencv-x64-cmake | 3f9486510d706c8ac579ac82f5d58f667f948124 | [
"Apache-2.0"
] | null | null | null | opencv/sources/modules/objdetect/misc/python/test/test_qrcode_detect.py | vrushank-agrawal/opencv-x64-cmake | 3f9486510d706c8ac579ac82f5d58f667f948124 | [
"Apache-2.0"
] | null | null | null | opencv/sources/modules/objdetect/misc/python/test/test_qrcode_detect.py | vrushank-agrawal/opencv-x64-cmake | 3f9486510d706c8ac579ac82f5d58f667f948124 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
'''
===============================================================================
QR code detect and decode pipeline.
===============================================================================
'''
import os
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTes... | 42 | 98 | 0.61186 |
import os
import numpy as np
import cv2 as cv
from tests_common import NewOpenCVTests
class qrcode_detector_test(NewOpenCVTests):
def test_detect(self):
img = cv.imread(os.path.join(self.extraTestDataPath, 'cv/qrcode/link_ocv.jpg'))
self.assertFalse(img is None)
detector = cv.... | true | true |
f740dc335ed402ce121be83717faa206dce90513 | 13,309 | py | Python | Deploy_Model.py | junaid340/AnomalyDetection-In-SurveillanceVideos | 758cb507b8f106eb0d4366c3301ee7be355a40b3 | [
"MIT"
] | 5 | 2020-09-16T08:35:39.000Z | 2022-01-27T09:22:38.000Z | Deploy_Model.py | junaid340/AnomalyDetection-In-SurveillanceVideos | 758cb507b8f106eb0d4366c3301ee7be355a40b3 | [
"MIT"
] | 2 | 2021-07-27T07:08:23.000Z | 2021-12-25T10:40:15.000Z | Deploy_Model.py | junaid340/AnomalyDetection-In-SurveillanceVideos | 758cb507b8f106eb0d4366c3301ee7be355a40b3 | [
"MIT"
] | 1 | 2020-12-19T11:04:22.000Z | 2020-12-19T11:04:22.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 2 20:56:50 2020
@author: junaid
"""
import cv2
import Model_Wrapper as mp
from tensorflow.keras.models import load_model
from PreProcessing_V5 import Fit_Preprocessing, GlobalNormalization, ToJson
from PreProcessing_V5 import ReadFileNames
import numpy as np
im... | 39.847305 | 258 | 0.612368 |
import cv2
import Model_Wrapper as mp
from tensorflow.keras.models import load_model
from PreProcessing_V5 import Fit_Preprocessing, GlobalNormalization, ToJson
from PreProcessing_V5 import ReadFileNames
import numpy as np
import tensorflow as tf
print('\nTensorflow GPU installed: '+str(tf.test.is_built_wit... | true | true |
f740dc4a4d301bd5c3281f79aab5265a2fcc2316 | 1,564 | py | Python | setup.py | janpipek/conveiro | 173b7f1cff99464e799750d84ba6583d2d226354 | [
"Apache-2.0"
] | null | null | null | setup.py | janpipek/conveiro | 173b7f1cff99464e799750d84ba6583d2d226354 | [
"Apache-2.0"
] | null | null | null | setup.py | janpipek/conveiro | 173b7f1cff99464e799750d84ba6583d2d226354 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
import os
import codecs
from conveiro import __version__
with codecs.open(os.path.join(os.path.dirname(__file__), 'README.md'), 'r', encoding='utf-8') as f:
description = f.read()
setup(
author='The ShowmaxLab & Showmax teams',
author_email='oss+conveiro@showm... | 32.583333 | 99 | 0.63491 | from setuptools import find_packages, setup
import os
import codecs
from conveiro import __version__
with codecs.open(os.path.join(os.path.dirname(__file__), 'README.md'), 'r', encoding='utf-8') as f:
description = f.read()
setup(
author='The ShowmaxLab & Showmax teams',
author_email='oss+conveiro@showm... | true | true |
f740dc73930b197629a263c04d10099c9d72b0d6 | 1,225 | py | Python | skia/tools/skp/page_sets/skia_capitalvolkswagen_mobile.py | jiangkang/renderer-dog | 8081732e2b4dbdb97c8d1f5e23f9e52c6362ff85 | [
"MIT"
] | null | null | null | skia/tools/skp/page_sets/skia_capitalvolkswagen_mobile.py | jiangkang/renderer-dog | 8081732e2b4dbdb97c8d1f5e23f9e52c6362ff85 | [
"MIT"
] | 1 | 2020-09-13T11:08:17.000Z | 2020-09-13T11:08:17.000Z | skia/tools/skp/page_sets/skia_capitalvolkswagen_mobile.py | jiangkang/renderer-dog | 8081732e2b4dbdb97c8d1f5e23f9e52c6362ff85 | [
"MIT"
] | null | null | null | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0401,W0614
from telemetry import story
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
clas... | 29.878049 | 74 | 0.745306 |
from telemetry import story
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
class SkiaMobilePage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaMobilePage, self).__init__(
url=url,
name=url,
page_set=page_set,
sh... | true | true |
f740dd69898c5946389ea3aca0aa45d13cce9802 | 815 | py | Python | plt.subplots2.py | shubhamtheds/charts-matplotlib | 72bbcafbb5960d8af13c17b47b0379e5024a0d7d | [
"MIT"
] | null | null | null | plt.subplots2.py | shubhamtheds/charts-matplotlib | 72bbcafbb5960d8af13c17b47b0379e5024a0d7d | [
"MIT"
] | null | null | null | plt.subplots2.py | shubhamtheds/charts-matplotlib | 72bbcafbb5960d8af13c17b47b0379e5024a0d7d | [
"MIT"
] | null | null | null | # Create a figure and an array of axes: 2 rows, 1 column with shared y axis
fig, ax = plt.subplots(2, 1, sharey=True)
# Plot Seattle precipitation data in the top axes
ax[0].plot(seattle_weather["MONTH"], seattle_weather["MLY-PRCP-NORMAL"], color = "b")
ax[0].plot(seattle_weather["MONTH"], seattle_weather["MLY-PRCP-25... | 58.214286 | 103 | 0.69816 |
fig, ax = plt.subplots(2, 1, sharey=True)
ax[0].plot(seattle_weather["MONTH"], seattle_weather["MLY-PRCP-NORMAL"], color = "b")
ax[0].plot(seattle_weather["MONTH"], seattle_weather["MLY-PRCP-25PCTL"], color = "b", linestyle = "--")
ax[0].plot(seattle_weather["MONTH"], seattle_weather["MLY-PRCP-75PCTL"], color = "b",... | true | true |
f740dd8b6c87603210727b82fd5935343f155abf | 2,267 | py | Python | test/test_train.py | giuseppefutia/PyTorch-BigGraph | 8b7f1cdc4d488305624de99a9245a21432881144 | [
"BSD-3-Clause"
] | null | null | null | test/test_train.py | giuseppefutia/PyTorch-BigGraph | 8b7f1cdc4d488305624de99a9245a21432881144 | [
"BSD-3-Clause"
] | null | null | null | test/test_train.py | giuseppefutia/PyTorch-BigGraph | 8b7f1cdc4d488305624de99a9245a21432881144 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE.txt file in the root directory of this source tree.
from itertools import product
from unittest import TestCase, main
from torchbiggraph... | 34.348485 | 72 | 0.593736 |
from itertools import product
from unittest import TestCase, main
from torchbiggraph.train import IterationManager
class TestIterationManager(TestCase):
def test_full(self):
im = IterationManager(
num_epochs=2, edge_paths=["A", "B", "C"], num_edge_chunks=4)
self.assertEqual(l... | true | true |
f740de8c76e9af50df5dc4115805887719bc5694 | 2,090 | py | Python | homog_gau_abc.py | utsav-akhaury/Computational-Electromagnetics-FDTD-Analysis | add2df141ba9c6414b19ac55d24c4251bbd05430 | [
"MIT"
] | 3 | 2021-06-22T10:33:08.000Z | 2021-11-16T09:12:16.000Z | homog_gau_abc.py | utsav-akhaury/Computational-Electromagnetics-FDTD-Analysis | add2df141ba9c6414b19ac55d24c4251bbd05430 | [
"MIT"
] | null | null | null | homog_gau_abc.py | utsav-akhaury/Computational-Electromagnetics-FDTD-Analysis | add2df141ba9c6414b19ac55d24c4251bbd05430 | [
"MIT"
] | null | null | null |
#------------------ Gaussian pulse propagation in a homogeneous medium terminated with Absorbing Boundary Condition (ABC)
import numpy as np
import matplotlib.pyplot as plt
#----- Medium ----------
length = 2
eps0 = 8.854e-12
meu0 = 4*np.pi*1e-7
epsr = 1
meur = 1
eps = eps0*epsr
meu = meu0*meu... | 28.630137 | 122 | 0.455024 |
import numpy as np
import matplotlib.pyplot as plt
length = 2
eps0 = 8.854e-12
meu0 = 4*np.pi*1e-7
epsr = 1
meur = 1
eps = eps0*epsr
meu = meu0*meur
c = 3e8
v = c/np.sqrt(epsr*meur)
freq = 3e9
lamda = v/freq
dz = lamda/10
dt = dz/v
N_cells = int(length/dz)
Mid_cell = int(N_cells/... | true | true |
f740df5af50c87927ee29ac4a46f9e8e06121095 | 1,587 | py | Python | tasks/urls.py | tschelbs18/fruitful | 66635cd521ffc0990275e32298419bfc2167b90b | [
"MIT"
] | null | null | null | tasks/urls.py | tschelbs18/fruitful | 66635cd521ffc0990275e32298419bfc2167b90b | [
"MIT"
] | 4 | 2020-06-04T14:20:33.000Z | 2021-09-22T19:09:22.000Z | tasks/urls.py | tschelbs18/fruitful | 66635cd521ffc0990275e32298419bfc2167b90b | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="home"),
path("register", views.register_view, name="register"),
path("login", views.login_view, name="login"),
path("logout", views.logout_view, name="logout"),
path("error_report", views.error_view, name="error"),
... | 52.9 | 111 | 0.73661 | from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="home"),
path("register", views.register_view, name="register"),
path("login", views.login_view, name="login"),
path("logout", views.logout_view, name="logout"),
path("error_report", views.error_view, name="error"),
... | true | true |
f740e0e1137cdcb52de487c72820c0e3089c36db | 87 | py | Python | assets/multiqc_plugins/multiqc_zymo/modules/__init__.py | laclac102/ampliseq | b3eb9e68840de925dffc956d51bf01359b4d4358 | [
"MIT"
] | null | null | null | assets/multiqc_plugins/multiqc_zymo/modules/__init__.py | laclac102/ampliseq | b3eb9e68840de925dffc956d51bf01359b4d4358 | [
"MIT"
] | null | null | null | assets/multiqc_plugins/multiqc_zymo/modules/__init__.py | laclac102/ampliseq | b3eb9e68840de925dffc956d51bf01359b4d4358 | [
"MIT"
] | null | null | null | import os
template_dir = os.path.dirname(__file__)
template_fn = 'multiqc_report.html' | 21.75 | 40 | 0.804598 | import os
template_dir = os.path.dirname(__file__)
template_fn = 'multiqc_report.html' | true | true |
f740e14daf60a930531566f6c63e551c6a10c997 | 889 | py | Python | spyql/utils.py | alin23/spyql | 41105b7c536ae21139d0d89cfb6b2a8b6deebf1e | [
"MIT"
] | 432 | 2021-08-17T16:52:36.000Z | 2022-03-30T15:33:26.000Z | spyql/utils.py | alin23/spyql | 41105b7c536ae21139d0d89cfb6b2a8b6deebf1e | [
"MIT"
] | 48 | 2021-07-27T17:18:05.000Z | 2022-03-15T09:33:01.000Z | spyql/utils.py | alin23/spyql | 41105b7c536ae21139d0d89cfb6b2a8b6deebf1e | [
"MIT"
] | 16 | 2021-11-27T15:42:42.000Z | 2022-02-16T11:36:37.000Z | import re
def quote_ifstr(s):
return f"'{s}'" if isinstance(s, str) else s
def make_str_valid_varname(s):
# remove invalid characters (except spaces in-between)
s = re.sub(r"[^0-9a-zA-Z_\s]", " ", s).strip()
# replace spaces by underscores (instead of dropping spaces) for readability
s = re.sub... | 25.4 | 84 | 0.642295 | import re
def quote_ifstr(s):
return f"'{s}'" if isinstance(s, str) else s
def make_str_valid_varname(s):
s = re.sub(r"[^0-9a-zA-Z_\s]", " ", s).strip()
s = re.sub(r"\s+", "_", s)
if not re.match("^[a-zA-Z_]", s):
s = "_" + s
return s
def try2eval(val, globals={}, loc... | true | true |
f740e228e0b62bbe43064d535a1535d696803ad6 | 4,510 | py | Python | avalanche/benchmarks/datasets/core50/core50.py | lebrice/avalanche | fe7e1e664ab20697343495fbe1328a20215feffb | [
"MIT"
] | 1 | 2021-07-26T08:01:47.000Z | 2021-07-26T08:01:47.000Z | avalanche/benchmarks/datasets/core50/core50.py | lebrice/avalanche | fe7e1e664ab20697343495fbe1328a20215feffb | [
"MIT"
] | null | null | null | avalanche/benchmarks/datasets/core50/core50.py | lebrice/avalanche | fe7e1e664ab20697343495fbe1328a20215feffb | [
"MIT"
] | 1 | 2021-06-19T12:37:10.000Z | 2021-06-19T12:37:10.000Z | ################################################################################
# Copyright (c) 2021 ContinualAI. #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. ... | 31.985816 | 80 | 0.524612 | true | true | |
f740e258c6ddedd4d86ef898a743558536e30f67 | 411 | py | Python | Rest_API_Beginner/wsgi.py | Moazam05/profiles-rest-api | e94b5c1c64eae08ba8853c3604d9b17ec2e8bcf3 | [
"MIT"
] | null | null | null | Rest_API_Beginner/wsgi.py | Moazam05/profiles-rest-api | e94b5c1c64eae08ba8853c3604d9b17ec2e8bcf3 | [
"MIT"
] | null | null | null | Rest_API_Beginner/wsgi.py | Moazam05/profiles-rest-api | e94b5c1c64eae08ba8853c3604d9b17ec2e8bcf3 | [
"MIT"
] | null | null | null | """
WSGI config for Rest_API_Beginner project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJ... | 24.176471 | 78 | 0.79562 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Rest_API_Beginner.settings')
application = get_wsgi_application()
| true | true |
f740e2608269080899f8f3837c5137340890037a | 205 | py | Python | src/robot_properties_solo/robot_properties_solo/__init__.py | Danfoa/robot_properties_solo | b0b9fb7025a343750b26b3c0e6d882794a4c61c1 | [
"BSD-3-Clause"
] | 25 | 2019-10-06T15:25:25.000Z | 2022-01-03T20:38:45.000Z | src/robot_properties_solo/robot_properties_solo/__init__.py | Danfoa/robot_properties_solo | b0b9fb7025a343750b26b3c0e6d882794a4c61c1 | [
"BSD-3-Clause"
] | 23 | 2019-09-05T18:11:45.000Z | 2022-02-11T10:04:51.000Z | src/robot_properties_solo/robot_properties_solo/__init__.py | Danfoa/robot_properties_solo | b0b9fb7025a343750b26b3c0e6d882794a4c61c1 | [
"BSD-3-Clause"
] | 17 | 2020-04-28T12:31:47.000Z | 2022-02-17T22:33:36.000Z | """__init__
License: BSD 3-Clause License
Copyright (C) 2018-2019, New York University , Max Planck Gesellschaft
Copyright note valid unless otherwise stated in individual files.
All rights reserved.
"""
| 25.625 | 70 | 0.785366 | true | true | |
f740e2f00e2358d6c09a7197a59a71a3b5b66924 | 296 | py | Python | qcdb/driver/__init__.py | vivacebelles/qcdb | 5bbdcb5c833277647a36bb0a5982abb56bf29b20 | [
"BSD-3-Clause"
] | 1 | 2019-02-20T20:18:02.000Z | 2019-02-20T20:18:02.000Z | qcdb/driver/__init__.py | vivacebelles/qcdb | 5bbdcb5c833277647a36bb0a5982abb56bf29b20 | [
"BSD-3-Clause"
] | null | null | null | qcdb/driver/__init__.py | vivacebelles/qcdb | 5bbdcb5c833277647a36bb0a5982abb56bf29b20 | [
"BSD-3-Clause"
] | null | null | null | from .proc_table import procedures
#from .driver import *
from .energy import energy, properties
from .gradient import gradient
from .hessian import hessian, frequency
from .optimize import optking, geometric
#from .cbs_helpers import *
#from .yaml import yaml_run
#from .driver_helpers import *
| 29.6 | 40 | 0.804054 | from .proc_table import procedures
from .energy import energy, properties
from .gradient import gradient
from .hessian import hessian, frequency
from .optimize import optking, geometric
| true | true |
f740e391b13769a418e4bb6b6b74e1d1678e41fd | 2,944 | py | Python | vas/gemfire/PendingApplicationCodes.py | appsuite/vas-python-api | c5df2b784d2d175034384eca368d78827fa8846b | [
"Apache-2.0"
] | 1 | 2020-05-26T23:49:47.000Z | 2020-05-26T23:49:47.000Z | vas/gemfire/PendingApplicationCodes.py | appsuite/vas-python-api | c5df2b784d2d175034384eca368d78827fa8846b | [
"Apache-2.0"
] | null | null | null | vas/gemfire/PendingApplicationCodes.py | appsuite/vas-python-api | c5df2b784d2d175034384eca368d78827fa8846b | [
"Apache-2.0"
] | 1 | 2019-03-12T02:33:51.000Z | 2019-03-12T02:33:51.000Z | # vFabric Administration Server API
# Copyright (c) 2012 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0... | 50.758621 | 120 | 0.563179 |
from vas.gemfire.ApplicationCode import ApplicationCode
from vas.shared.Deletable import Deletable
from vas.shared.MutableCollection import MutableCollection
class PendingApplicationCodes(MutableCollection):
def __init__(self, client, location):
super(PendingApplicationCodes, self).__init_... | true | true |
f740e46ebcfa2e7fa2c8b5c1c6a67768834069ea | 50,990 | py | Python | build/generator/gen_win_dependencies.py | markphip/subversion | b68ad49667ccd4a3fd3083c24909e6fcca4b8348 | [
"Apache-2.0"
] | null | null | null | build/generator/gen_win_dependencies.py | markphip/subversion | b68ad49667ccd4a3fd3083c24909e6fcca4b8348 | [
"Apache-2.0"
] | 1 | 2016-09-14T18:22:43.000Z | 2016-09-14T18:22:43.000Z | build/generator/gen_win_dependencies.py | markphip/subversion | b68ad49667ccd4a3fd3083c24909e6fcca4b8348 | [
"Apache-2.0"
] | 1 | 2020-11-04T07:25:49.000Z | 2020-11-04T07:25:49.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 n... | 34.948595 | 113 | 0.580957 |
import os
import sys
import fnmatch
import re
import subprocess
import string
if sys.version_info[0] >= 3:
from io import StringIO
else:
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import gen_base
import ezt
class SVNCommonLibr... | true | true |
f740e5cfaaa5bebce65b6a2af0a9f4d2f31598f7 | 58,473 | py | Python | tensorflow/python/framework/function_test.py | LTHODAVDOPL/tensorflow | 73083d29afe770870742a9d19555686886e76f6d | [
"Apache-2.0"
] | 1 | 2018-10-28T11:12:12.000Z | 2018-10-28T11:12:12.000Z | tensorflow/python/framework/function_test.py | LTHODAVDOPL/tensorflow | 73083d29afe770870742a9d19555686886e76f6d | [
"Apache-2.0"
] | null | null | null | tensorflow/python/framework/function_test.py | LTHODAVDOPL/tensorflow | 73083d29afe770870742a9d19555686886e76f6d | [
"Apache-2.0"
] | 1 | 2021-05-24T06:16:56.000Z | 2021-05-24T06:16:56.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 31.848039 | 80 | 0.646999 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
import sys
import time
import numpy as np
from tensorflow.core.framework import function_pb2
from tensorflow.core.protobuf import config_pb2
from tensorflow.core.protobuf import rewri... | true | true |
f740e5e58840bb10848c2f93a5ca4af0acf95de3 | 540 | py | Python | wrapper.py | 0rangeFox/easy-encryption | 226e831d98c98a52252c485b0ef47714fa4570be | [
"MIT"
] | 1 | 2022-02-12T04:15:24.000Z | 2022-02-12T04:15:24.000Z | wrapper.py | 0rangeFox/easy-encryption | 226e831d98c98a52252c485b0ef47714fa4570be | [
"MIT"
] | null | null | null | wrapper.py | 0rangeFox/easy-encryption | 226e831d98c98a52252c485b0ef47714fa4570be | [
"MIT"
] | 1 | 2022-02-12T04:15:25.000Z | 2022-02-12T04:15:25.000Z | import subprocess
def decrypt(message, key):
return subprocess.check_output(['./application.out', message, key, "1"]).decode('utf8').strip()
def encrypt(message, key):
return subprocess.check_output(['./application.out', message, key, "0"]).decode('utf8').strip()
if __name__ == '__main__':
original_msg =... | 33.75 | 99 | 0.675926 | import subprocess
def decrypt(message, key):
return subprocess.check_output(['./application.out', message, key, "1"]).decode('utf8').strip()
def encrypt(message, key):
return subprocess.check_output(['./application.out', message, key, "0"]).decode('utf8').strip()
if __name__ == '__main__':
original_msg =... | true | true |
f740e6f2ae1f6e95bcff7968463eebdef222c3ca | 2,634 | py | Python | JuliaSet/animation.py | DevelopedByET/PyFractals | ad5415cb47ddaad30e141bceb263ee0b25cf078e | [
"MIT"
] | null | null | null | JuliaSet/animation.py | DevelopedByET/PyFractals | ad5415cb47ddaad30e141bceb263ee0b25cf078e | [
"MIT"
] | null | null | null | JuliaSet/animation.py | DevelopedByET/PyFractals | ad5415cb47ddaad30e141bceb263ee0b25cf078e | [
"MIT"
] | null | null | null | # Native
import os
from math import *
from cmath import *
from time import time
# Installed
import cv2 as cv
# Custom Modules
from assets.utils import float_range
from JuliaSet.core import JuliaSet
class Animation:
def __init__(self, range_from: float or int, range_to: float or int, range_step: f... | 48.777778 | 190 | 0.625664 |
import os
from math import *
from cmath import *
from time import time
import cv2 as cv
from assets.utils import float_range
from JuliaSet.core import JuliaSet
class Animation:
def __init__(self, range_from: float or int, range_to: float or int, range_step: float, frames_folder: str = "out/JuliaS... | true | true |
f740e7537bf56cb8d2a2220e6613977f052c84d4 | 2,187 | py | Python | src/oci/logging/models/group_association_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/logging/models/group_association_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/logging/models/group_association_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 30.802817 | 245 | 0.66941 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class GroupAssociationDetails(object):
def __init__(self, **kwargs):
self.swagger_types = {
'group_list': '... | true | true |
f740e7b66648145db66b8dc5e661b1d33066d803 | 10,556 | py | Python | google/ads/googleads/v7/services/services/detail_placement_view_service/transports/grpc.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 285 | 2018-10-05T16:47:58.000Z | 2022-03-31T00:58:39.000Z | google/ads/googleads/v7/services/services/detail_placement_view_service/transports/grpc.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 425 | 2018-09-10T13:32:41.000Z | 2022-03-31T14:50:05.000Z | google/ads/googleads/v7/services/services/detail_placement_view_service/transports/grpc.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | 369 | 2018-11-28T07:01:00.000Z | 2022-03-28T09:53:22.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 41.72332 | 105 | 0.625616 |
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple
from google.api_core import grpc_helpers
from google.api_core import gapic_v1
from google import auth
from google.auth import credentials
from google.auth.transport.grpc import SslCredentials
import grpc
from goog... | true | true |
f740e8cd0ed87ed33aa2ed3b93e06577b8990a19 | 1,013 | py | Python | darksite/cms/test/models/test_info_panel_model.py | UNCDarkside/DarksiteAPI | a4bc1f4adee7ecfba840ad45da22513f88acbbd0 | [
"MIT"
] | null | null | null | darksite/cms/test/models/test_info_panel_model.py | UNCDarkside/DarksiteAPI | a4bc1f4adee7ecfba840ad45da22513f88acbbd0 | [
"MIT"
] | 46 | 2018-12-19T06:53:37.000Z | 2019-01-11T18:20:05.000Z | darksite/cms/test/models/test_info_panel_model.py | UNCDarkside/DarksiteAPI | a4bc1f4adee7ecfba840ad45da22513f88acbbd0 | [
"MIT"
] | null | null | null | from cms import models
def test_create_no_media(db):
"""
Test creating an info panel.
"""
models.InfoPanel.objects.create(
text="The quick brown fox jumped over the lazy dog.", title="No Media"
)
def test_ordering(info_panel_factory):
"""
Panels should be ordered by their ``order... | 23.55814 | 78 | 0.655479 | from cms import models
def test_create_no_media(db):
models.InfoPanel.objects.create(
text="The quick brown fox jumped over the lazy dog.", title="No Media"
)
def test_ordering(info_panel_factory):
p1 = info_panel_factory(order=2)
p2 = info_panel_factory(order=3)
p3 = info_panel_factory(... | true | true |
f740e913e06b43adf680ca078fb5256f93ca9461 | 1,433 | py | Python | losses/classification_losses.py | visinf/deblur-devil | 53cc4c72a4ddb9dcede5ee52dc53000c39ff5dab | [
"Apache-2.0"
] | 18 | 2019-11-02T05:45:48.000Z | 2021-09-12T10:03:08.000Z | losses/classification_losses.py | visinf/deblur-devil | 53cc4c72a4ddb9dcede5ee52dc53000c39ff5dab | [
"Apache-2.0"
] | 3 | 2019-12-10T07:52:24.000Z | 2021-04-07T19:14:31.000Z | losses/classification_losses.py | visinf/deblur-devil | 53cc4c72a4ddb9dcede5ee52dc53000c39ff5dab | [
"Apache-2.0"
] | 3 | 2020-05-26T08:02:05.000Z | 2020-09-26T21:25:10.000Z | # Author: Jochen Gast <jochen.gast@visinf.tu-darmstadt.de>
import torch
import torch.nn as nn
from losses import factory
class ClassificationLoss(nn.Module):
def __init__(self, args, topk=(1, 2, 3), reduction='mean'):
super().__init__()
self.args = args
self.cross_entropy = t... | 31.844444 | 76 | 0.593859 |
import torch
import torch.nn as nn
from losses import factory
class ClassificationLoss(nn.Module):
def __init__(self, args, topk=(1, 2, 3), reduction='mean'):
super().__init__()
self.args = args
self.cross_entropy = torch.nn.CrossEntropyLoss(reduction=reduction)
self... | true | true |
f740e9188e23989d7d8cb429eceb0134b86a65bd | 194 | py | Python | hallucinate/api.py | SySS-Research/hallucinate | f6dbeea0599e232707e6cf27c3fe592edba92f6f | [
"MIT"
] | 199 | 2021-07-27T13:47:14.000Z | 2022-03-05T09:18:56.000Z | hallucinate/api.py | avineshwar/hallucinate | f6dbeea0599e232707e6cf27c3fe592edba92f6f | [
"MIT"
] | 1 | 2021-12-08T19:32:29.000Z | 2021-12-08T19:32:29.000Z | hallucinate/api.py | avineshwar/hallucinate | f6dbeea0599e232707e6cf27c3fe592edba92f6f | [
"MIT"
] | 13 | 2021-07-27T18:55:03.000Z | 2021-08-09T06:15:35.000Z | class BaseHandler:
def send(self, data, p):
pass
def recv(self, data, p):
pass
def shutdown(self, p, direction=2):
pass
def close(self):
pass
| 13.857143 | 39 | 0.525773 | class BaseHandler:
def send(self, data, p):
pass
def recv(self, data, p):
pass
def shutdown(self, p, direction=2):
pass
def close(self):
pass
| true | true |
f740ea68b269ffb8604d4ac5371e84be4c0343a0 | 7,387 | py | Python | diofant/solvers/polysys.py | diofant/omg | 72fd45f832240d1ded6f0a411e97bb9f7aa9f1d2 | [
"BSD-3-Clause"
] | null | null | null | diofant/solvers/polysys.py | diofant/omg | 72fd45f832240d1ded6f0a411e97bb9f7aa9f1d2 | [
"BSD-3-Clause"
] | null | null | null | diofant/solvers/polysys.py | diofant/omg | 72fd45f832240d1ded6f0a411e97bb9f7aa9f1d2 | [
"BSD-3-Clause"
] | null | null | null | """Solvers of systems of polynomial equations."""
import collections
from ..core import expand_mul
from ..domains import EX
from ..matrices import Matrix
from ..polys import (ComputationFailed, PolificationFailed, groebner,
parallel_poly_from_expr)
from ..polys.solvers import solve_lin_sys
from .... | 29.666667 | 81 | 0.569785 |
import collections
from ..core import expand_mul
from ..domains import EX
from ..matrices import Matrix
from ..polys import (ComputationFailed, PolificationFailed, groebner,
parallel_poly_from_expr)
from ..polys.solvers import solve_lin_sys
from ..simplify.simplify import simplify
from ..utilitie... | true | true |
f740ea8839ee763a0b88c31e0182b5f1f8482e17 | 1,415 | py | Python | pybot/plugins/api/endpoints.py | harikrishnana2021/operationcode-pybot | 6e78e069c274281d50dcb71b98b9f485afb012fc | [
"MIT"
] | null | null | null | pybot/plugins/api/endpoints.py | harikrishnana2021/operationcode-pybot | 6e78e069c274281d50dcb71b98b9f485afb012fc | [
"MIT"
] | null | null | null | pybot/plugins/api/endpoints.py | harikrishnana2021/operationcode-pybot | 6e78e069c274281d50dcb71b98b9f485afb012fc | [
"MIT"
] | null | null | null | import asyncio
import json
import logging
from aiohttp.web_response import Response
from pybot.plugins.api.request import FailedVerification, SlackApiRequest
logger = logging.getLogger(__name__)
async def slack_api(request):
api_plugin = request.app.plugins["api"]
try:
slack_request = SlackApiRequ... | 26.698113 | 86 | 0.686219 | import asyncio
import json
import logging
from aiohttp.web_response import Response
from pybot.plugins.api.request import FailedVerification, SlackApiRequest
logger = logging.getLogger(__name__)
async def slack_api(request):
api_plugin = request.app.plugins["api"]
try:
slack_request = SlackApiRequ... | true | true |
f740eaca88eb56ec04ca0a55415f0a43b3932bf4 | 5,560 | py | Python | aleph/views/documents_api.py | gazeti/aleph | f6714c4be038471cfdc6408bfe88dc9e2ed28452 | [
"MIT"
] | 1 | 2017-07-28T12:54:09.000Z | 2017-07-28T12:54:09.000Z | aleph/views/documents_api.py | gazeti/aleph | f6714c4be038471cfdc6408bfe88dc9e2ed28452 | [
"MIT"
] | 7 | 2017-08-16T12:49:23.000Z | 2018-02-16T10:22:11.000Z | aleph/views/documents_api.py | gazeti/aleph | f6714c4be038471cfdc6408bfe88dc9e2ed28452 | [
"MIT"
] | 6 | 2017-07-26T12:29:53.000Z | 2017-08-18T09:35:50.000Z | import logging
from werkzeug.exceptions import BadRequest, NotFound
from flask import Blueprint, redirect, send_file, request
from apikit import jsonify, Pager, request_data
from aleph.core import archive, url_for, db
from aleph.model import Document, DocumentRecord, Entity, Reference
from aleph.logic import update_do... | 36.339869 | 79 | 0.690647 | import logging
from werkzeug.exceptions import BadRequest, NotFound
from flask import Blueprint, redirect, send_file, request
from apikit import jsonify, Pager, request_data
from aleph.core import archive, url_for, db
from aleph.model import Document, DocumentRecord, Entity, Reference
from aleph.logic import update_do... | true | true |
f740ed436ef2c2630723fe677b0528a372283095 | 193 | py | Python | tests/urls.py | geelweb/geelweb-django-contactform | f4f83e285a77c38205b5097cc22aa1354e3b618d | [
"MIT"
] | 2 | 2020-12-13T00:10:51.000Z | 2021-03-07T10:35:08.000Z | tests/urls.py | geelweb/geelweb-django-contactform | f4f83e285a77c38205b5097cc22aa1354e3b618d | [
"MIT"
] | null | null | null | tests/urls.py | geelweb/geelweb-django-contactform | f4f83e285a77c38205b5097cc22aa1354e3b618d | [
"MIT"
] | 2 | 2016-04-09T14:10:26.000Z | 2016-10-30T00:40:53.000Z | from django.urls import include, path
from . import views
urlpatterns = [
path('', views.index),
path('custom/', views.custom),
path('contact/', include('contactform.urls')),
]
| 21.444444 | 51 | 0.647668 | from django.urls import include, path
from . import views
urlpatterns = [
path('', views.index),
path('custom/', views.custom),
path('contact/', include('contactform.urls')),
]
| true | true |
f740ee10b4b1715be60825616bd8531eeee888e6 | 5,058 | py | Python | server/onlineCAL/settings.py | ujjwal-raizada/lab-booking-system | 4eed0941104d635d90ed74d31f30e2698474a9ea | [
"MIT"
] | null | null | null | server/onlineCAL/settings.py | ujjwal-raizada/lab-booking-system | 4eed0941104d635d90ed74d31f30e2698474a9ea | [
"MIT"
] | 5 | 2020-02-02T15:41:48.000Z | 2020-12-15T08:43:25.000Z | server/onlineCAL/settings.py | ujjwal-raizada/lab-booking-system | 4eed0941104d635d90ed74d31f30e2698474a9ea | [
"MIT"
] | 5 | 2020-01-10T16:29:15.000Z | 2022-01-07T05:30:19.000Z | """
Django settings for onlineCAL project.
Generated by 'django-admin startproject' using Django 2.2.4.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
... | 27.340541 | 91 | 0.696323 |
import os
import os.path
from dotenv import load_dotenv
from django.contrib import messages
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
ENV_LOCATION = os.path.join(BASE_DIR, 'proj.env')
if os.path.exists(ENV_LOCATION):
load_dotenv(ENV_L... | true | true |
f740eee90c469570104f2439b1d5521c644c5924 | 7,006 | py | Python | Lib/test/test_compiler/test_static/decl_visitor.py | itamaro/cinder | a08198c185a255b59f85dc84183558370a0c5284 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/test/test_compiler/test_static/decl_visitor.py | itamaro/cinder | a08198c185a255b59f85dc84183558370a0c5284 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/test/test_compiler/test_static/decl_visitor.py | itamaro/cinder | a08198c185a255b59f85dc84183558370a0c5284 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | import ast
import re
from compiler.static import StaticCodeGenerator
from compiler.static.compiler import Compiler
from compiler.static.module_table import ModuleTable
from textwrap import dedent
from .common import StaticTestBase, bad_ret_type
class DeclarationVisitorTests(StaticTestBase):
def test_cross_module... | 29.686441 | 87 | 0.450614 | import ast
import re
from compiler.static import StaticCodeGenerator
from compiler.static.compiler import Compiler
from compiler.static.module_table import ModuleTable
from textwrap import dedent
from .common import StaticTestBase, bad_ret_type
class DeclarationVisitorTests(StaticTestBase):
def test_cross_module... | true | true |
f740efc841b24305ddc0869071927f1c8d9e6107 | 16,807 | py | Python | edith_v0.1.py | TheForgotensoul/Edith-Virtual-Assistant | d77c37405aa59ab63acb1f7d8680582a0ef3f296 | [
"MIT"
] | 2 | 2020-07-02T11:55:58.000Z | 2022-01-26T15:45:54.000Z | edith_v0.1.py | TheForgotensoul/Edith-Virtual-Assistant | d77c37405aa59ab63acb1f7d8680582a0ef3f296 | [
"MIT"
] | null | null | null | edith_v0.1.py | TheForgotensoul/Edith-Virtual-Assistant | d77c37405aa59ab63acb1f7d8680582a0ef3f296 | [
"MIT"
] | 1 | 2021-04-01T18:15:41.000Z | 2021-04-01T18:15:41.000Z | import pyttsx3
import datetime
import time as t
import smtplib
import wikipedia
import webbrowser as wb
import os
import string
import wolframalpha
import pyautogui
import psutil
import pyjokes
import random
from colored import fg, attr
import speech_recognition as sr
print(f"""{fg(226)}{attr(1)}
... | 37.266075 | 126 | 0.450289 | import pyttsx3
import datetime
import time as t
import smtplib
import wikipedia
import webbrowser as wb
import os
import string
import wolframalpha
import pyautogui
import psutil
import pyjokes
import random
from colored import fg, attr
import speech_recognition as sr
print(f"""{fg(226)}{attr(1)}
... | true | true |
f740f0d695df4286edf457600cb1ea4cffda95b0 | 15,688 | py | Python | class6/ANSIBLE/library/eos_purge.py | cdieken/python_class | 7daf3600da7488baa3756ab454922824af8b711f | [
"Apache-2.0"
] | null | null | null | class6/ANSIBLE/library/eos_purge.py | cdieken/python_class | 7daf3600da7488baa3756ab454922824af8b711f | [
"Apache-2.0"
] | null | null | null | class6/ANSIBLE/library/eos_purge.py | cdieken/python_class | 7daf3600da7488baa3756ab454922824af8b711f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright (c) 2015, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# t... | 32.147541 | 86 | 0.624873 |
DOCUMENTATION = """
---
module: eos_purge
short_description: Purges resources from an Arista EOS node
description:
- The eos_purge module will scan the current nodes running-configuration
and purge resources of a specified type if the resource is not explicitly
configured in th... | true | true |
f740f17bf5f6b1ee0b660cbd87968c5e40a3fa1d | 1,301 | py | Python | examples/simple/stream_scene_camera_video.py | pupil-labs/realtime-python-api | 1dc84f248cac07c30e83e6b857e779e7a30b5218 | [
"MIT"
] | 1 | 2021-12-17T09:41:38.000Z | 2021-12-17T09:41:38.000Z | examples/simple/stream_scene_camera_video.py | pupil-labs/realtime-python-api | 1dc84f248cac07c30e83e6b857e779e7a30b5218 | [
"MIT"
] | 2 | 2022-01-19T15:23:12.000Z | 2022-01-25T09:26:54.000Z | examples/simple/stream_scene_camera_video.py | papr/realtime-api | 89e6188ef097489d86218fbf5796163210ab03d6 | [
"MIT"
] | null | null | null | import cv2
from pupil_labs.realtime_api.simple import discover_one_device
def main():
# Look for devices. Returns as soon as it has found the first device.
print("Looking for the next best device...")
device = discover_one_device(max_search_duration_seconds=10)
if device is None:
print("No de... | 25.019231 | 75 | 0.627978 | import cv2
from pupil_labs.realtime_api.simple import discover_one_device
def main():
print("Looking for the next best device...")
device = discover_one_device(max_search_duration_seconds=10)
if device is None:
print("No device found.")
raise SystemExit(-1)
print(f"Connecting to... | true | true |
f740f1a6c207e8dd2d134dcecde3d076952eba98 | 1,097 | py | Python | bookmark/migrations/0001_initial.py | pietermarsman/startpage | 8f9a2d6d0c5d78c4781019dd7491a40ea7699f2c | [
"Apache-2.0"
] | null | null | null | bookmark/migrations/0001_initial.py | pietermarsman/startpage | 8f9a2d6d0c5d78c4781019dd7491a40ea7699f2c | [
"Apache-2.0"
] | 24 | 2017-12-02T18:56:46.000Z | 2018-03-31T16:56:02.000Z | bookmark/migrations/0001_initial.py | pietermarsman/startpage | 8f9a2d6d0c5d78c4781019dd7491a40ea7699f2c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-02 19:03
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Creat... | 29.648649 | 114 | 0.566089 |
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Bookmark',
fields=[
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.