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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f716ca32bfbce92f904eda519d192105b6956caa | 3,447 | py | Python | cmdbox/scaffold_templates/migrations/0002_auto_20160404_2007.py | vitorfs/cmdbox | 97806c02caf5947ec855286212e61db714e3fb02 | [
"MIT"
] | 1 | 2019-09-07T11:49:11.000Z | 2019-09-07T11:49:11.000Z | cmdbox/scaffold_templates/migrations/0002_auto_20160404_2007.py | vitorfs/cmdbox | 97806c02caf5947ec855286212e61db714e3fb02 | [
"MIT"
] | null | null | null | cmdbox/scaffold_templates/migrations/0002_auto_20160404_2007.py | vitorfs/cmdbox | 97806c02caf5947ec855286212e61db714e3fb02 | [
"MIT"
] | 2 | 2018-09-04T08:33:17.000Z | 2020-09-18T20:26:46.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-04 20:07
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('scaffold_templates', '0001_... | 42.036585 | 158 | 0.59385 | from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('scaffold_templates', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | true | true |
f716cbce48a8f8203417dcba6fc313bd1d90bcd9 | 5,760 | py | Python | test/visualization/test_visualization.py | chrhck/pyABC | 731cfdec26bef3898bf6e244daa5c8f83f3fe19d | [
"BSD-3-Clause"
] | null | null | null | test/visualization/test_visualization.py | chrhck/pyABC | 731cfdec26bef3898bf6e244daa5c8f83f3fe19d | [
"BSD-3-Clause"
] | null | null | null | test/visualization/test_visualization.py | chrhck/pyABC | 731cfdec26bef3898bf6e244daa5c8f83f3fe19d | [
"BSD-3-Clause"
] | null | null | null | import pyabc
import tempfile
import pytest
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# create and run some model
def model(p):
return {'ss0': p['p0'] + 0.1 * np.random.uniform(),
'ss1': p['p1'] + 0.1 * np.random.uniform()}
p_true = {'p0': 3, 'p1': 4}
observat... | 32.542373 | 79 | 0.64375 | import pyabc
import tempfile
import pytest
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def model(p):
return {'ss0': p['p0'] + 0.1 * np.random.uniform(),
'ss1': p['p1'] + 0.1 * np.random.uniform()}
p_true = {'p0': 3, 'p1': 4}
observation = {'ss0': p_true['p0'], ... | true | true |
f716cd537ee2ce3b739c2b138de0ba36abc67390 | 8,949 | py | Python | tools/vsnp/vsnp_statistics.py | supernord/tools-iuc | 9a0c41967765d120a8fc519c0c7f09cbe3a6efbe | [
"MIT"
] | 1 | 2019-07-05T13:19:51.000Z | 2019-07-05T13:19:51.000Z | tools/vsnp/vsnp_statistics.py | mtekman/tools-iuc | 95f1ae4ed1cdd56114df76d215f9e1ed549aa4c5 | [
"MIT"
] | 8 | 2019-05-27T20:54:44.000Z | 2021-10-04T09:33:30.000Z | tools/vsnp/vsnp_statistics.py | mtekman/tools-iuc | 95f1ae4ed1cdd56114df76d215f9e1ed549aa4c5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
import csv
import gzip
import os
from functools import partial
import numpy
import pandas
from Bio import SeqIO
def nice_size(size):
# Returns a readably formatted string with the size
words = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB']
prefix = ''
try:
... | 46.128866 | 169 | 0.658956 |
import argparse
import csv
import gzip
import os
from functools import partial
import numpy
import pandas
from Bio import SeqIO
def nice_size(size):
words = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB']
prefix = ''
try:
size = float(size)
if size < 0:
size = abs(size)
... | true | true |
f716cd5d7134a3961ffe080fd5955660a50ac9e2 | 4,759 | py | Python | augmented_seq2seq/datasets/friends/data.py | jsedoc/nn_chatbot | 7b4406687bad2efa14658cb5aa137065cd325073 | [
"MIT"
] | 2 | 2017-07-22T15:34:02.000Z | 2017-12-07T07:28:56.000Z | augmented_seq2seq/datasets/friends/data.py | jsedoc/nn_chatbot | 7b4406687bad2efa14658cb5aa137065cd325073 | [
"MIT"
] | null | null | null | augmented_seq2seq/datasets/friends/data.py | jsedoc/nn_chatbot | 7b4406687bad2efa14658cb5aa137065cd325073 | [
"MIT"
] | 3 | 2017-06-09T10:30:22.000Z | 2020-02-25T02:29:58.000Z | FILENAME = 'sequences_full.csv'
VOCAB_SIZE = None
UNK = 'UNK'
POS_TAGS = { 'CC' : '<CC>', 'CD' : '<CD>', 'DT' : '<DT>', 'EX' : '<EX>', 'FW' : '<FW>', 'IN' : '<IN>', 'JJ' : '<JJ>', 'JJR' : '<JJR>', 'JJS' : '<JJS>', 'LS' : '<LS>', 'MD' : '<MD>', 'NN' : '<NN>', 'NNS' : '<NNS>', 'NNP' : '<NNP>', 'NNPS' : '<NNPS>', 'PDT' :... | 25.86413 | 595 | 0.548645 | FILENAME = 'sequences_full.csv'
VOCAB_SIZE = None
UNK = 'UNK'
POS_TAGS = { 'CC' : '<CC>', 'CD' : '<CD>', 'DT' : '<DT>', 'EX' : '<EX>', 'FW' : '<FW>', 'IN' : '<IN>', 'JJ' : '<JJ>', 'JJR' : '<JJR>', 'JJS' : '<JJS>', 'LS' : '<LS>', 'MD' : '<MD>', 'NN' : '<NN>', 'NNS' : '<NNS>', 'NNP' : '<NNP>', 'NNPS' : '<NNPS>', 'PDT' :... | true | true |
f716cd6b0558dfb762b9277089b16cb9576044b2 | 1,613 | py | Python | venv/lib/python3.6/site-packages/xero_python/payrollau/models/timesheets.py | 6enno/FarmXero | 881b1e6648e927631b276e66a4c5287e4de2cbc1 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/xero_python/payrollau/models/timesheets.py | 6enno/FarmXero | 881b1e6648e927631b276e66a4c5287e4de2cbc1 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/xero_python/payrollau/models/timesheets.py | 6enno/FarmXero | 881b1e6648e927631b276e66a4c5287e4de2cbc1 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Xero Payroll AU
This is the Xero Payroll API for orgs in Australia region. # noqa: E501
Contact: api@xero.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
from xero_python.models import BaseModel
class Timesheets(BaseModel):
"""NOTE: This clas... | 24.815385 | 76 | 0.619343 |
import re
from xero_python.models import BaseModel
class Timesheets(BaseModel):
openapi_types = {"timesheets": "list[Timesheet]"}
attribute_map = {"timesheets": "Timesheets"}
def __init__(self, timesheets=None):
self._timesheets = None
self.discriminator = None
if timesh... | true | true |
f716ce82d68d18fd209d91f8e1db052c5725c571 | 6,938 | py | Python | assignment2/cs231n/optim.py | Abhijeet8901/CS231n | c8e715028b453899d5069cdb34faf3fc2959c270 | [
"MIT"
] | null | null | null | assignment2/cs231n/optim.py | Abhijeet8901/CS231n | c8e715028b453899d5069cdb34faf3fc2959c270 | [
"MIT"
] | null | null | null | assignment2/cs231n/optim.py | Abhijeet8901/CS231n | c8e715028b453899d5069cdb34faf3fc2959c270 | [
"MIT"
] | null | null | null | import numpy as np
"""
This file implements various first-order update rules that are commonly used
for training neural networks. Each update rule accepts current weights and the
gradient of the loss with respect to those weights and produces the next set of
weights. Each update rule has the same interface:
def updat... | 38.544444 | 79 | 0.537763 | import numpy as np
def sgd(w, dw, config=None):
if config is None:
config = {}
config.setdefault("learning_rate", 1e-2)
w -= config["learning_rate"] * dw
return w, config
def sgd_momentum(w, dw, config=None):
if config is None:
config = {}
config.setdefault("learning_rate",... | true | true |
f716cea90be05811860d24af0a9d540d7d2e2e6c | 4,451 | py | Python | code/distributeHI.py | modichirag/21cmhod | 0807a7b0b880f4ba5bc7161b843d500ddcece5a7 | [
"MIT"
] | null | null | null | code/distributeHI.py | modichirag/21cmhod | 0807a7b0b880f4ba5bc7161b843d500ddcece5a7 | [
"MIT"
] | null | null | null | code/distributeHI.py | modichirag/21cmhod | 0807a7b0b880f4ba5bc7161b843d500ddcece5a7 | [
"MIT"
] | null | null | null | import numpy as np
import re, os
from pmesh.pm import ParticleMesh
from nbodykit.lab import BigFileCatalog, BigFileMesh, MultipleSpeciesCatalog, FFTPower
from nbodykit import setup_logging
from mpi4py import MPI
import HImodels
# enable logging, we have some clue what's going on.
setup_logging('info')
#... | 34.238462 | 106 | 0.625927 | import numpy as np
import re, os
from pmesh.pm import ParticleMesh
from nbodykit.lab import BigFileCatalog, BigFileMesh, MultipleSpeciesCatalog, FFTPower
from nbodykit import setup_logging
from mpi4py import MPI
import HImodels
setup_logging('info')
#Get model as parameter
import argparse
parser = argpa... | true | true |
f716cec14ad98ba7140fbdbb91cb9e7cbc9274b0 | 11,751 | py | Python | couplet_composer/project.py | anttikivi/couplet-composer | 0f6aaf894b35ea60d8047c0072ec146d4e1d2a6f | [
"MIT"
] | null | null | null | couplet_composer/project.py | anttikivi/couplet-composer | 0f6aaf894b35ea60d8047c0072ec146d4e1d2a6f | [
"MIT"
] | 16 | 2020-10-29T17:31:47.000Z | 2022-03-07T17:01:52.000Z | couplet_composer/project.py | anttikivi/couplet-composer | 0f6aaf894b35ea60d8047c0072ec146d4e1d2a6f | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Antti Kivi
# Licensed under the MIT License
"""A module that contains the class that represents the project
that the build script acts on.
"""
import importlib
import json
import logging
import os
from typing import Any, List
from .support.system import System
from .support import environment
... | 33.864553 | 79 | 0.537997 |
import importlib
import json
import logging
import os
from typing import Any, List
from .support.system import System
from .support import environment
from .binary_dependency import BinaryDependency
from .dependency import Dependency
class Project:
SHARED_VERSION_KEY = "shared_version"
SHARED_USAGE_VA... | true | true |
f716cf2c2f40b9fb26a797c10a0e167af41d51ea | 1,354 | py | Python | petpetgif/petpet.py | Gst0ne/pet-pet-gif | e219a859558df99424625e3dc51b287e5c7674ff | [
"MIT"
] | 1 | 2021-11-06T13:14:01.000Z | 2021-11-06T13:14:01.000Z | petpetgif/petpet.py | Gst0ne/pet-pet-gif | e219a859558df99424625e3dc51b287e5c7674ff | [
"MIT"
] | null | null | null | petpetgif/petpet.py | Gst0ne/pet-pet-gif | e219a859558df99424625e3dc51b287e5c7674ff | [
"MIT"
] | 1 | 2021-11-12T08:50:24.000Z | 2021-11-12T08:50:24.000Z | from PIL import Image
from petpetgif.saveGif import save_transparent_gif
from pkg_resources import resource_stream
frames = 10
resolution = (128, 128)
delay = 20
def make(source, dest):
"""
:param source: A filename (string), pathlib.Path object or a file object. (This parameter corresponds
... | 38.685714 | 162 | 0.639586 | from PIL import Image
from petpetgif.saveGif import save_transparent_gif
from pkg_resources import resource_stream
frames = 10
resolution = (128, 128)
delay = 20
def make(source, dest):
images = []
base = Image.open(source).convert('RGBA').resize(resolution)
for i in range(frames):
squeeze = i if... | true | true |
f716cf6f63fdd848b405bbb16c421fdd80bde9ff | 1,873 | py | Python | remora/tests/test_tracker.py | Hugoch/remora-python | 1bb19200135bb84ee5e6e28fe25057ed096c8e31 | [
"MIT"
] | null | null | null | remora/tests/test_tracker.py | Hugoch/remora-python | 1bb19200135bb84ee5e6e28fe25057ed096c8e31 | [
"MIT"
] | null | null | null | remora/tests/test_tracker.py | Hugoch/remora-python | 1bb19200135bb84ee5e6e28fe25057ed096c8e31 | [
"MIT"
] | null | null | null | import unittest
from remora.tracker import Tracker
from remora.collectors import AsyncCollector
import requests_mock
import json
class TestTracker(unittest.TestCase):
def test_send_payload(self):
url = 'http://127.0.0.1:31311'
with requests_mock.mock() as m:
req = m.put(url)
... | 39.020833 | 100 | 0.571276 | import unittest
from remora.tracker import Tracker
from remora.collectors import AsyncCollector
import requests_mock
import json
class TestTracker(unittest.TestCase):
def test_send_payload(self):
url = 'http://127.0.0.1:31311'
with requests_mock.mock() as m:
req = m.put(url)
... | true | true |
f716d0756983d74be295f8050487b4e269c28f44 | 3,562 | py | Python | src/client/user_bonus.py | ZackPashkin/toloka-kit | 8f650e5d8cdded1949ca633cf78f9b851ce839bb | [
"Apache-2.0"
] | 153 | 2021-02-06T13:41:11.000Z | 2022-03-19T17:51:01.000Z | src/client/user_bonus.py | ZackPashkin/toloka-kit | 8f650e5d8cdded1949ca633cf78f9b851ce839bb | [
"Apache-2.0"
] | 29 | 2021-01-15T12:54:37.000Z | 2022-02-07T07:45:32.000Z | src/client/user_bonus.py | ZackPashkin/toloka-kit | 8f650e5d8cdded1949ca633cf78f9b851ce839bb | [
"Apache-2.0"
] | 17 | 2021-01-29T15:20:04.000Z | 2022-01-30T07:21:03.000Z | __all__ = [
'UserBonus',
'UserBonusCreateRequestParameters'
]
from attr.validators import optional, instance_of
import datetime
from decimal import Decimal
from typing import Any
from .primitives.base import BaseTolokaObject
from .primitives.parameter import Parameters
from ..util._codegen import attribute
c... | 36.721649 | 130 | 0.630264 | __all__ = [
'UserBonus',
'UserBonusCreateRequestParameters'
]
from attr.validators import optional, instance_of
import datetime
from decimal import Decimal
from typing import Any
from .primitives.base import BaseTolokaObject
from .primitives.parameter import Parameters
from ..util._codegen import attribute
c... | true | true |
f716d0a144b04a18cf4e4f949f0d63ac16f60306 | 120,881 | py | Python | src/sage/misc/sage_input.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/misc/sage_input.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/misc/sage_input.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | 1 | 2020-07-24T12:20:37.000Z | 2020-07-24T12:20:37.000Z | r"""
Sage Input Formatting
This module provides the function :func:`sage_input` that takes an
arbitrary sage value and produces a sequence of commands that, if typed
at the ``sage:`` prompt, will recreate the value. If this is not
implemented for a particular value, then an exception is raised instead.
This might be u... | 33.624757 | 151 | 0.56051 |
def sage_input(x, preparse=True, verify=False, allow_locals=False):
if not verify:
sib = SageInputBuilder(allow_locals=allow_locals, preparse=preparse)
return sib.result(sib(x))
for pp in (True, False, None):
sib = SageInputBuilder(allow_locals=allow_locals, preparse=pp)
... | true | true |
f716d301aba4afe90bc5d5c6ec197a440bdc19f2 | 3,047 | py | Python | contrib/testgen/base58.py | Trackerming/bitcoin-sv | fb50a64e3ea0334a86b2c80daf5147c5bc2693c4 | [
"MIT"
] | 35 | 2019-02-23T06:21:13.000Z | 2021-11-15T11:35:13.000Z | contrib/testgen/base58.py | Chihuataneo/bitcoin-sv | d9b12a23dbf0d2afc5f488fa077d762b302ba873 | [
"MIT"
] | 60 | 2019-02-25T18:17:03.000Z | 2021-07-13T00:14:00.000Z | contrib/testgen/base58.py | Chihuataneo/bitcoin-sv | d9b12a23dbf0d2afc5f488fa077d762b302ba873 | [
"MIT"
] | 24 | 2019-02-20T05:37:02.000Z | 2021-10-29T18:42:10.000Z | # Copyright (c) 2012-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import has... | 24.772358 | 97 | 0.624549 | import hashlib
class SHA256:
new = hashlib.sha256
if str != bytes:
def ord(c):
return c
def chr(n):
return bytes((n,))
__b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
__b58base = len(__b58chars)
b58chars = __b58chars
def b58encode(v):
long_value = 0... | true | true |
f716d420b906d891f1c046d6c7abb726027eaa2b | 4,749 | py | Python | ml-services/od-yolov3-tf2/yolov3_tf2/utils.py | jveverka/data-lab | c2a43fd2c34520a9d490f29feff3035bdc70c0d6 | [
"Apache-2.0"
] | null | null | null | ml-services/od-yolov3-tf2/yolov3_tf2/utils.py | jveverka/data-lab | c2a43fd2c34520a9d490f29feff3035bdc70c0d6 | [
"Apache-2.0"
] | 6 | 2019-12-07T09:53:26.000Z | 2020-05-21T19:52:27.000Z | ml-services/od-yolov3-tf2/yolov3_tf2/utils.py | jveverka/data-lab | c2a43fd2c34520a9d490f29feff3035bdc70c0d6 | [
"Apache-2.0"
] | null | null | null | from absl import logging
import numpy as np
import tensorflow as tf
import cv2
YOLOV3_LAYER_LIST = [
'yolo_darknet',
'yolo_conv_0',
'yolo_output_0',
'yolo_conv_1',
'yolo_output_1',
'yolo_conv_2',
'yolo_output_2',
]
YOLOV3_TINY_LAYER_LIST = [
'yolo_darknet',
'yolo_conv_0',
'yolo... | 35.177778 | 83 | 0.561592 | from absl import logging
import numpy as np
import tensorflow as tf
import cv2
YOLOV3_LAYER_LIST = [
'yolo_darknet',
'yolo_conv_0',
'yolo_output_0',
'yolo_conv_1',
'yolo_output_1',
'yolo_conv_2',
'yolo_output_2',
]
YOLOV3_TINY_LAYER_LIST = [
'yolo_darknet',
'yolo_conv_0',
'yolo... | true | true |
f716d445c1bcac531c48494bd19770afcbb198fa | 1,377 | py | Python | dags/tuto.py | setuk/docker-airflow | 8741ac32094893e1cd56b8bd411d240f60453eb7 | [
"Apache-2.0"
] | null | null | null | dags/tuto.py | setuk/docker-airflow | 8741ac32094893e1cd56b8bd411d240f60453eb7 | [
"Apache-2.0"
] | null | null | null | dags/tuto.py | setuk/docker-airflow | 8741ac32094893e1cd56b8bd411d240f60453eb7 | [
"Apache-2.0"
] | null | null | null | """
Code that goes along with the Airflow located at:
http://airflow.readthedocs.org/en/latest/tutorial.html
"""
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
"owner": "airflow",
"depends_on_past": False,
"start_d... | 27.54 | 82 | 0.67175 | from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
"owner": "airflow",
"depends_on_past": False,
"start_date": datetime(2020, 11, 19),
"email": ["airflow@airflow.com"],
"email_on_failure": False,
"email_on_... | true | true |
f716d497d29ec78b5afc1dd07eb0f92340ba179b | 8,724 | py | Python | benchmark/cloud/aws/kylin.py | ChenYi015/Raven | e732e03f8dd118ed805a143fc6916f0e5fc53c2c | [
"Apache-2.0"
] | 1 | 2022-03-03T05:54:25.000Z | 2022-03-03T05:54:25.000Z | benchmark/cloud/aws/kylin.py | ChenYi015/Raven | e732e03f8dd118ed805a143fc6916f0e5fc53c2c | [
"Apache-2.0"
] | null | null | null | benchmark/cloud/aws/kylin.py | ChenYi015/Raven | e732e03f8dd118ed805a143fc6916f0e5fc53c2c | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Raven 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 applicable law or ... | 36.810127 | 118 | 0.634457 | import json
import logging
import os
import threading
import time
from typing import List
from benchmark.cloud.aws.aws import Ec2Instance, AmazonWebService
from benchmark.tools import get_random_id
logger = logging.getLogger()
class KylinMode:
ALL = 'all'
JOB = 'job'
QUERY = 'query'
class KylinMaster(... | true | true |
f716d4d8c9c6fc2d044b19e6dd1de0835c5c8e87 | 285 | py | Python | Blog/sitemaps.py | myselfajp/MyFirstPage | c22b2fbe6ddca6f0af199f51ec7f12894458a91b | [
"MIT"
] | null | null | null | Blog/sitemaps.py | myselfajp/MyFirstPage | c22b2fbe6ddca6f0af199f51ec7f12894458a91b | [
"MIT"
] | null | null | null | Blog/sitemaps.py | myselfajp/MyFirstPage | c22b2fbe6ddca6f0af199f51ec7f12894458a91b | [
"MIT"
] | null | null | null | from django.contrib.sitemaps import Sitemap
from Blog.models import Post
class BlogSitemap(Sitemap):
changefreq = "weekly"
priority = 0.5
def items(self):
return Post.objects.filter(status=True)
def lastmod(self, obj):
return obj.published_date
| 20.357143 | 47 | 0.687719 | from django.contrib.sitemaps import Sitemap
from Blog.models import Post
class BlogSitemap(Sitemap):
changefreq = "weekly"
priority = 0.5
def items(self):
return Post.objects.filter(status=True)
def lastmod(self, obj):
return obj.published_date
| true | true |
f716d5594aa167180b878069286e9c1308907fdf | 9,503 | py | Python | tests/infra/jsonrpc.py | rschust/CCF | 2ad5f162cd73c645070f26461d8d053b45f63c3e | [
"Apache-2.0"
] | null | null | null | tests/infra/jsonrpc.py | rschust/CCF | 2ad5f162cd73c645070f26461d8d053b45f63c3e | [
"Apache-2.0"
] | null | null | null | tests/infra/jsonrpc.py | rschust/CCF | 2ad5f162cd73c645070f26461d8d053b45f63c3e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import socket
import ssl
import msgpack
import struct
import select
import contextlib
import json
import logging
import time
import os
from enum import IntEnum
from cryptography import x509
from cryptography.hazmat.back... | 27.78655 | 86 | 0.573398 | import socket
import ssl
import msgpack
import struct
import select
import contextlib
import json
import logging
import time
import os
from enum import IntEnum
from cryptography import x509
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import asymmetric
from loguru import... | true | true |
f716d560b71358551851abec5503a1ab0331080f | 8,345 | py | Python | tests/providers/test_automotive.py | MarcelRobeer/faker | 016ef66c6852ed7d5f198b54dc620bd784ce58c2 | [
"MIT"
] | null | null | null | tests/providers/test_automotive.py | MarcelRobeer/faker | 016ef66c6852ed7d5f198b54dc620bd784ce58c2 | [
"MIT"
] | null | null | null | tests/providers/test_automotive.py | MarcelRobeer/faker | 016ef66c6852ed7d5f198b54dc620bd784ce58c2 | [
"MIT"
] | null | null | null | import re
from typing import Pattern
from faker.providers.automotive.de_DE import Provider as DeDeAutomotiveProvider
from faker.providers.automotive.es_ES import Provider as EsEsAutomotiveProvider
from faker.providers.automotive.ro_RO import Provider as RoRoAutomotiveProvider
from faker.providers.automotive.ru_RU imp... | 37.59009 | 115 | 0.670461 | import re
from typing import Pattern
from faker.providers.automotive.de_DE import Provider as DeDeAutomotiveProvider
from faker.providers.automotive.es_ES import Provider as EsEsAutomotiveProvider
from faker.providers.automotive.ro_RO import Provider as RoRoAutomotiveProvider
from faker.providers.automotive.ru_RU imp... | true | true |
f716d625081f9ebcae5efd23c12ecb9272c56c04 | 887 | py | Python | qubo_nn/plots/gen_tsne_gen4.py | instance01/qubo-nn | 6f8058565f4b6ab4a8300501fc2f67cdaeed482f | [
"MIT"
] | 9 | 2021-09-17T09:40:59.000Z | 2022-03-29T13:41:25.000Z | qubo_nn/plots/gen_tsne_gen4.py | instance01/qubo-nn | 6f8058565f4b6ab4a8300501fc2f67cdaeed482f | [
"MIT"
] | null | null | null | qubo_nn/plots/gen_tsne_gen4.py | instance01/qubo-nn | 6f8058565f4b6ab4a8300501fc2f67cdaeed482f | [
"MIT"
] | 4 | 2022-03-06T19:26:19.000Z | 2022-03-29T13:41:37.000Z | import pickle
import numpy as np
from MulticoreTSNE import MulticoreTSNE as TSNE
from qubo_nn.data import LMDBDataLoader
from qubo_nn.config import Config
cfg_id = '27_gen4'
cfg = Config('../').get_cfg(cfg_id)
cfg["use_big"] = False
lmdb_loader = LMDBDataLoader(cfg, reverse=False, base_path='../')
X = []
y = []
for ... | 23.972973 | 68 | 0.622322 | import pickle
import numpy as np
from MulticoreTSNE import MulticoreTSNE as TSNE
from qubo_nn.data import LMDBDataLoader
from qubo_nn.config import Config
cfg_id = '27_gen4'
cfg = Config('../').get_cfg(cfg_id)
cfg["use_big"] = False
lmdb_loader = LMDBDataLoader(cfg, reverse=False, base_path='../')
X = []
y = []
for ... | true | true |
f716d781ce1344228dd00f5ca854221451fb21f6 | 1,862 | py | Python | tests/extras/test_tooltips.py | Akuli/tkinder | c360fbfe086ca09cdd856a8636de05b24e1b7093 | [
"MIT"
] | 23 | 2019-01-15T00:07:30.000Z | 2022-01-18T06:19:18.000Z | tests/extras/test_tooltips.py | Akuli/tkinder | c360fbfe086ca09cdd856a8636de05b24e1b7093 | [
"MIT"
] | 12 | 2019-01-13T19:51:52.000Z | 2021-05-17T17:55:51.000Z | tests/extras/test_tooltips.py | Akuli/pythotk | c360fbfe086ca09cdd856a8636de05b24e1b7093 | [
"MIT"
] | 7 | 2019-01-13T19:48:26.000Z | 2021-04-21T13:30:21.000Z | import time
import types
import pytest
import teek
from teek.extras import tooltips
def run_event_loop(for_how_long):
# this is dumb
start = time.time()
while time.time() < start + for_how_long:
teek.update()
@pytest.mark.slow
def test_set_tooltip():
window = teek.Window()
assert not ha... | 31.559322 | 77 | 0.749194 | import time
import types
import pytest
import teek
from teek.extras import tooltips
def run_event_loop(for_how_long):
start = time.time()
while time.time() < start + for_how_long:
teek.update()
@pytest.mark.slow
def test_set_tooltip():
window = teek.Window()
assert not hasattr(window, '... | true | true |
f716d8668d7f3e71327a13ddba27d41f18e2ef20 | 49 | py | Python | ecommerce/shipping.py | broach44/beginning-python | 54fb51ce666e263e7a76c37bb39cb6df636886ca | [
"MIT"
] | null | null | null | ecommerce/shipping.py | broach44/beginning-python | 54fb51ce666e263e7a76c37bb39cb6df636886ca | [
"MIT"
] | null | null | null | ecommerce/shipping.py | broach44/beginning-python | 54fb51ce666e263e7a76c37bb39cb6df636886ca | [
"MIT"
] | null | null | null | def calc_shipping():
print("calc shipping")
| 12.25 | 26 | 0.673469 | def calc_shipping():
print("calc shipping")
| true | true |
f716d9590903bcc9299b90cc70855136916fd55d | 1,613 | py | Python | old_versions/TCA_2_2/TCA_V_2_2_1/code/TCASpacePartitioning.py | OSADP/TCA | 25bc1c1db00393cc6b8c6764610bf381494dfcb9 | [
"Apache-2.0"
] | 1 | 2021-05-22T00:06:09.000Z | 2021-05-22T00:06:09.000Z | old_versions/TCA_2_2/TCA_V_2_2_1/code/TCASpacePartitioning.py | OSADP/TCA | 25bc1c1db00393cc6b8c6764610bf381494dfcb9 | [
"Apache-2.0"
] | null | null | null | old_versions/TCA_2_2/TCA_V_2_2_1/code/TCASpacePartitioning.py | OSADP/TCA | 25bc1c1db00393cc6b8c6764610bf381494dfcb9 | [
"Apache-2.0"
] | null | null | null | #standard
import unittest
import math
# from collections import OrderedDict
from random import uniform
#external
import pandas as pd
from scipy.spatial import KDTree
def Find_RSE_range(df, RSEs, minrange):
sub_df = df[['vehicle_ID', 'location_x', 'location_y']]
tree = KDTree(sub_df[['location_x', 'locati... | 26.442623 | 105 | 0.594544 | import unittest
import math
from random import uniform
import pandas as pd
from scipy.spatial import KDTree
def Find_RSE_range(df, RSEs, minrange):
sub_df = df[['vehicle_ID', 'location_x', 'location_y']]
tree = KDTree(sub_df[['location_x', 'location_y']].values)
rse_points = list(RSEs.RSEListLocation... | true | true |
f716da328dd870f9e5d396ba489f4d3b821fa89f | 720 | py | Python | bin/make_halo_cnf_data.py | muntazirabidi/boss-sbi | fae016eb10b64153391499276d238ccdf660df88 | [
"MIT"
] | 1 | 2022-03-15T18:13:02.000Z | 2022-03-15T18:13:02.000Z | bin/make_halo_cnf_data.py | muntazirabidi/boss-sbi | fae016eb10b64153391499276d238ccdf660df88 | [
"MIT"
] | 11 | 2020-12-16T18:26:31.000Z | 2021-04-02T14:58:37.000Z | bin/make_halo_cnf_data.py | muntazirabidi/boss-sbi | fae016eb10b64153391499276d238ccdf660df88 | [
"MIT"
] | 2 | 2021-03-29T17:33:54.000Z | 2021-04-01T16:07:07.000Z | import os
import numpy as np
from simbig import halos as Halos
np.random.seed(918234)
theta_x_pairs = []
for i in range(1000):
# read in halo catalog
halos = Halos.Quijote_LHC_HR(i, z=0.5)
# impose random halo mass limit as a proxy for baryonic effect
Mlim = np.random.uniform(12.5, 13.0)
the... | 28.8 | 103 | 0.6875 | import os
import numpy as np
from simbig import halos as Halos
np.random.seed(918234)
theta_x_pairs = []
for i in range(1000):
halos = Halos.Quijote_LHC_HR(i, z=0.5)
Mlim = np.random.uniform(12.5, 13.0)
theta_cosmo = Halos.Quijote_LHC_cosmo(i)
Nhalos = np.sum(np.array(halos['Mass']) ... | true | true |
f716da8fd6c32ba467ca558698e188b418c2559d | 10,502 | py | Python | scripts/build-ios.py | ArtronicsGame/mobile-sdk | 492afb38fbf372d2e76534b8f92e433b7cfb69b5 | [
"BSD-3-Clause"
] | null | null | null | scripts/build-ios.py | ArtronicsGame/mobile-sdk | 492afb38fbf372d2e76534b8f92e433b7cfb69b5 | [
"BSD-3-Clause"
] | null | null | null | scripts/build-ios.py | ArtronicsGame/mobile-sdk | 492afb38fbf372d2e76534b8f92e433b7cfb69b5 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
import re
import shutil
import argparse
import string
from build.sdk_build_utils import *
IOS_ARCHS = ['i386', 'x86_64', 'armv7', 'arm64']
def updateUmbrellaHeader(filename, args):
with open(filename, 'r') as f:
lines = f.readlines()
for i in range(0, len(lines)):
match = re.searc... | 45.463203 | 245 | 0.668444 | import os
import sys
import re
import shutil
import argparse
import string
from build.sdk_build_utils import *
IOS_ARCHS = ['i386', 'x86_64', 'armv7', 'arm64']
def updateUmbrellaHeader(filename, args):
with open(filename, 'r') as f:
lines = f.readlines()
for i in range(0, len(lines)):
match = re.searc... | true | true |
f716db30ad2b5a1b0baa72fd74c8fbb701037f01 | 1,189 | py | Python | tools/accuracy_checker/openvino/tools/accuracy_checker/postprocessor/normalize_salient_map.py | TolyaTalamanov/open_model_zoo | 1697e60712df4ca72635a2080a197b9d3bc24129 | [
"Apache-2.0"
] | 2,201 | 2018-10-15T14:37:19.000Z | 2020-07-16T02:05:51.000Z | tools/accuracy_checker/openvino/tools/accuracy_checker/postprocessor/normalize_salient_map.py | Pandinosaurus/open_model_zoo | 2543996541346418919c5cddfb71e33e2cdef080 | [
"Apache-2.0"
] | 759 | 2018-10-18T07:43:55.000Z | 2020-07-16T01:23:12.000Z | tools/accuracy_checker/openvino/tools/accuracy_checker/postprocessor/normalize_salient_map.py | Pandinosaurus/open_model_zoo | 2543996541346418919c5cddfb71e33e2cdef080 | [
"Apache-2.0"
] | 808 | 2018-10-16T14:03:49.000Z | 2020-07-15T11:41:45.000Z | """
Copyright (c) 2018-2022 Intel Corporation
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 wri... | 34.970588 | 72 | 0.702271 | import cv2
import numpy as np
from .postprocessor import Postprocessor
class SalientMapNormalizer(Postprocessor):
__provider__ = 'normalize_salience_map'
def process_image(self, annotation, prediction):
for ann in annotation:
gt_mask = ann.mask
if len(gt_mask.shape) == 3 and g... | true | true |
f716dbad5d5deabbd30519182541764ab0c17a2f | 10,478 | py | Python | cynetworkx/algorithms/isomorphism/temporalisomorphvf2.py | Viech/cynetworkx | 01a37859c67b752392e9e783c949084964eef2cf | [
"BSD-3-Clause"
] | 12 | 2019-07-23T08:07:53.000Z | 2022-03-09T06:13:16.000Z | cynetworkx/algorithms/isomorphism/temporalisomorphvf2.py | Viech/cynetworkx | 01a37859c67b752392e9e783c949084964eef2cf | [
"BSD-3-Clause"
] | 7 | 2019-08-30T07:00:00.000Z | 2021-12-30T08:02:56.000Z | cynetworkx/algorithms/isomorphism/temporalisomorphvf2.py | Viech/cynetworkx | 01a37859c67b752392e9e783c949084964eef2cf | [
"BSD-3-Clause"
] | 5 | 2020-10-10T03:40:32.000Z | 2021-11-23T12:28:53.000Z | # -*- coding: utf-8 -*-
"""
*****************************
Time-respecting VF2 Algorithm
*****************************
An extension of the VF2 algorithm for time-respecting graph ismorphism
testing in temporal graphs.
A temporal graph is one in which edges contain a datetime attribute,
denoting when interaction occurr... | 38.664207 | 124 | 0.655564 |
from __future__ import absolute_import
import cynetworkx as nx
from datetime import datetime, timedelta
from .isomorphvf2 import GraphMatcher, DiGraphMatcher
__all__ = ['TimeRespectingGraphMatcher',
'TimeRespectingDiGraphMatcher']
class TimeRespectingGraphMatcher(GraphMatcher):
def __init__(self, G1... | true | true |
f716dcbb37cfe64fdd5bab29b9a4cfa9b3b000b2 | 33,058 | py | Python | pyccel/ast/operators.py | jalalium/pyccel | 4f3d9a359e42c16440e9c841059257d292a8361b | [
"MIT"
] | null | null | null | pyccel/ast/operators.py | jalalium/pyccel | 4f3d9a359e42c16440e9c841059257d292a8361b | [
"MIT"
] | null | null | null | pyccel/ast/operators.py | jalalium/pyccel | 4f3d9a359e42c16440e9c841059257d292a8361b | [
"MIT"
] | null | null | null | #------------------------------------------------------------------------------------------#
# This file is part of Pyccel which is released under MIT License. See the LICENSE file or #
# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. #
#----------------------------------------... | 30.134913 | 134 | 0.563918 |
from ..errors.errors import Errors, PyccelSemanticError
from .basic import PyccelAstNode
from .datatypes import (NativeBool, NativeInteger, NativeReal,
NativeComplex, NativeString, default_precision,
NativeNume... | true | true |
f716dcc5929dc395b511c231b73a25ba28485635 | 607 | py | Python | apps/shortener_app/migrations/0009_auto_20190123_1903.py | escrichov/shortener | f8a72edb0b40c20021541f5178f257590b478e02 | [
"MIT"
] | 6 | 2018-12-16T12:35:18.000Z | 2020-06-07T13:06:17.000Z | apps/shortener_app/migrations/0009_auto_20190123_1903.py | escrichov/shortener | f8a72edb0b40c20021541f5178f257590b478e02 | [
"MIT"
] | 16 | 2019-06-10T19:10:01.000Z | 2022-02-12T04:22:55.000Z | apps/shortener_app/migrations/0009_auto_20190123_1903.py | escrichov/shortener | f8a72edb0b40c20021541f5178f257590b478e02 | [
"MIT"
] | 1 | 2019-01-18T00:06:13.000Z | 2019-01-18T00:06:13.000Z | # Generated by Django 2.1.5 on 2019-01-23 19:03
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shortener_app', '0008_auto_20181205_2300'),
]
operations = [
migrations.AddField(
model_name='shorturl',
... | 24.28 | 73 | 0.614498 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shortener_app', '0008_auto_20181205_2300'),
]
operations = [
migrations.AddField(
model_name='shorturl',
name='url_active',
field=models... | true | true |
f716dcdbe7007bf7839728fd2b9195c4311f4c1c | 2,821 | py | Python | src/elaspic_rest_api/app.py | elaspic/elaspic-rest-api | b1ed2dae1870b5d0c678d196e39c8c806959e640 | [
"MIT"
] | null | null | null | src/elaspic_rest_api/app.py | elaspic/elaspic-rest-api | b1ed2dae1870b5d0c678d196e39c8c806959e640 | [
"MIT"
] | null | null | null | src/elaspic_rest_api/app.py | elaspic/elaspic-rest-api | b1ed2dae1870b5d0c678d196e39c8c806959e640 | [
"MIT"
] | null | null | null | import asyncio
import logging
from typing import Any, Dict
import sentry_sdk
from fastapi import BackgroundTasks, FastAPI
from sentry_sdk.integrations.asgi import SentryAsgiMiddleware
import elaspic_rest_api
from elaspic_rest_api import config
from elaspic_rest_api import jobsubmitter as js
from elaspic_rest_api.type... | 27.930693 | 89 | 0.686636 | import asyncio
import logging
from typing import Any, Dict
import sentry_sdk
from fastapi import BackgroundTasks, FastAPI
from sentry_sdk.integrations.asgi import SentryAsgiMiddleware
import elaspic_rest_api
from elaspic_rest_api import config
from elaspic_rest_api import jobsubmitter as js
from elaspic_rest_api.type... | true | true |
f716dd589103e434f5c06b8eb30e4fe38d5df1b6 | 1,790 | py | Python | rpncalc/binaryoperator.py | newmanrs/rpncalc | 8663e5221efd78c12889b6db4eda20821b27d52a | [
"MIT"
] | null | null | null | rpncalc/binaryoperator.py | newmanrs/rpncalc | 8663e5221efd78c12889b6db4eda20821b27d52a | [
"MIT"
] | 11 | 2021-11-10T04:28:51.000Z | 2022-02-25T05:19:22.000Z | rpncalc/binaryoperator.py | newmanrs/rpncalc | 8663e5221efd78c12889b6db4eda20821b27d52a | [
"MIT"
] | null | null | null | import numpy
import math
from rpncalc.classes import ActionEnum
class BinaryOperator(ActionEnum):
addition = '+'
subtraction = '-'
multiplication = '*'
division = '/'
integer_division = '//'
power = '^'
atan2 = 'atan2', \
"Returns quadrant correct polar coordinate theta = atan2(y,... | 25.211268 | 70 | 0.430726 | import numpy
import math
from rpncalc.classes import ActionEnum
class BinaryOperator(ActionEnum):
addition = '+'
subtraction = '-'
multiplication = '*'
division = '/'
integer_division = '//'
power = '^'
atan2 = 'atan2', \
"Returns quadrant correct polar coordinate theta = atan2(y,... | true | true |
f716de749187532c276040a0b1e00777b44337ce | 592 | py | Python | api_logic_server_cli/project_prototype/util.py | valhuber/ApiLogicServer | a4acd8d886a18d4d500e0fffffcaa2f1c0765040 | [
"BSD-3-Clause"
] | 71 | 2021-01-23T17:34:33.000Z | 2022-03-29T13:11:29.000Z | api_logic_server_cli/project_prototype/util.py | valhuber/ApiLogicServer | a4acd8d886a18d4d500e0fffffcaa2f1c0765040 | [
"BSD-3-Clause"
] | 38 | 2021-01-24T21:56:30.000Z | 2022-03-08T18:49:00.000Z | api_logic_server_cli/project_prototype/util.py | valhuber/ApiLogicServer | a4acd8d886a18d4d500e0fffffcaa2f1c0765040 | [
"BSD-3-Clause"
] | 14 | 2021-01-23T16:20:44.000Z | 2022-03-24T10:48:28.000Z | import sqlite3
from os import path
import sys
import logging
app_logger = logging.getLogger("api_logic_server_app")
def log(msg: any) -> None:
app_logger.info(msg)
# print("TIL==> " + msg)
def connection() -> sqlite3.Connection:
ROOT: str = path.dirname(path.realpath(__file__))
log(ROOT)
_connec... | 22.769231 | 67 | 0.675676 | import sqlite3
from os import path
import sys
import logging
app_logger = logging.getLogger("api_logic_server_app")
def log(msg: any) -> None:
app_logger.info(msg)
def connection() -> sqlite3.Connection:
ROOT: str = path.dirname(path.realpath(__file__))
log(ROOT)
_connection = sqlite3.connect(pa... | true | true |
f716ded79220bf0850640a2412069bb981807960 | 3,633 | py | Python | meegkit/utils/trca.py | ludovicdmt/python-meegkit | 4aa4ba49354b996be20eda41660a550d1bd31f9a | [
"BSD-3-Clause"
] | null | null | null | meegkit/utils/trca.py | ludovicdmt/python-meegkit | 4aa4ba49354b996be20eda41660a550d1bd31f9a | [
"BSD-3-Clause"
] | null | null | null | meegkit/utils/trca.py | ludovicdmt/python-meegkit | 4aa4ba49354b996be20eda41660a550d1bd31f9a | [
"BSD-3-Clause"
] | null | null | null | """TRCA utils."""
import numpy as np
from scipy.signal import filtfilt, cheb1ord, cheby1
from scipy import stats
def round_half_up(num, decimals=0):
"""Round half up round the last decimal of the number.
The rules are:
from 0 to 4 rounds down
from 5 to 9 rounds up
Parameters
----------
... | 26.136691 | 78 | 0.570603 | import numpy as np
from scipy.signal import filtfilt, cheb1ord, cheby1
from scipy import stats
def round_half_up(num, decimals=0):
multiplier = 10 ** decimals
return int(np.floor(num * multiplier + 0.5) / multiplier)
def normfit(data, ci=0.95):
arr = 1.0 * np.array(data)
num = len(arr)
avg, std... | true | true |
f716df4ee14d7c3327f654e758f30bd597015ed0 | 4,458 | py | Python | book_code_selected_keras_examples/cifar/cifar10_cnn.py | IntuitionMachine/DeepLearningGuide | 7270b13ee5783a23482738cdf9d355c10d25360d | [
"MIT"
] | 1 | 2019-05-02T02:53:34.000Z | 2019-05-02T02:53:34.000Z | book_code_selected_keras_examples/cifar/cifar10_cnn.py | IntuitionMachine/DeepLearningGuide | 7270b13ee5783a23482738cdf9d355c10d25360d | [
"MIT"
] | null | null | null | book_code_selected_keras_examples/cifar/cifar10_cnn.py | IntuitionMachine/DeepLearningGuide | 7270b13ee5783a23482738cdf9d355c10d25360d | [
"MIT"
] | null | null | null | '''Train a simple deep CNN on the CIFAR10 small images dataset.
It gets to 75% validation accuracy in 25 epochs, and 79% after 50 epochs.
(it's still underfitting at that point, though).
'''
from __future__ import print_function
from time import time
import keras
from keras.datasets import cifar10
from keras.preproce... | 33.772727 | 97 | 0.711306 |
from __future__ import print_function
from time import time
import keras
from keras.datasets import cifar10
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential, load_model
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Conv2D, MaxPooling2D... | true | true |
f716dfa33ddc3edf22a30911544807cfce14bd8a | 247,289 | py | Python | tensorflow/python/framework/ops.py | jraman/tensorflow | 41c6bf7c6215bea9bfb9bf0a9b63f2084e6f3058 | [
"Apache-2.0"
] | 1 | 2020-10-01T16:52:51.000Z | 2020-10-01T16:52:51.000Z | tensorflow/python/framework/ops.py | rakeshacharya-d/tensorflow | 9028828d3b8a2a622f7203a317002cc749531695 | [
"Apache-2.0"
] | 1 | 2022-02-10T01:08:48.000Z | 2022-02-10T01:08:48.000Z | tensorflow/python/framework/ops.py | rakeshacharya-d/tensorflow | 9028828d3b8a2a622f7203a317002cc749531695 | [
"Apache-2.0"
] | null | null | null | # 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... | 36.68432 | 115 | 0.692594 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import re
import sys
import threading
import types
import numpy as np
import six
from six.moves import map from six.moves import xrange
from tensorflow.core.framework import attr_value_pb... | true | true |
f716e0b7ca7df97d982aaf86ed718db537ad482b | 49,994 | py | Python | research/compression/distillation/resnet.py | ragavvenkatesan/models | 420a88c7af20dae8d79dbc1b4351fef41be361c8 | [
"Apache-2.0"
] | null | null | null | research/compression/distillation/resnet.py | ragavvenkatesan/models | 420a88c7af20dae8d79dbc1b4351fef41be361c8 | [
"Apache-2.0"
] | null | null | null | research/compression/distillation/resnet.py | ragavvenkatesan/models | 420a88c7af20dae8d79dbc1b4351fef41be361c8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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... | 44.399645 | 139 | 0.67008 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import tensorflow as tf
_BATCH_NORM_DECAY = 0.997
_BATCH_NORM_EPSILON = 1e-5
def process_record_dataset(dataset, is_training, batch_size, shuffle_buffer,
... | true | true |
f716e0e1798b4361d576daa1b6e3bf179cfdaf7c | 5,362 | py | Python | tests/scripts/thread-cert/Cert_9_2_12_Announce.py | TanJay/openthread | ffd28ebd4d874fbc71f556ced86efc306e6a2d4b | [
"BSD-3-Clause"
] | 1 | 2018-12-31T08:12:49.000Z | 2018-12-31T08:12:49.000Z | tests/scripts/thread-cert/Cert_9_2_12_Announce.py | syin2/openthread | a9f42768ec221380f42bfd311bc68e784b2163a6 | [
"BSD-3-Clause"
] | null | null | null | tests/scripts/thread-cert/Cert_9_2_12_Announce.py | syin2/openthread | a9f42768ec221380f42bfd311bc68e784b2163a6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | 40.621212 | 114 | 0.70179 |
import time
import unittest
import node
LEADER1 = 1
ROUTER1 = 2
LEADER2 = 3
ROUTER2 = 4
MED = 5
DATASET1_TIMESTAMP = 20
DATASET1_CHANNEL = 11
DATASET1_PANID = 0xface
DATASET2_TIMESTAMP = 10
DATASET2_CHANNEL = 12
DATASET2_PANID = 0xafce
class Cert_9_2_12_Announce(unittest.TestCase):
def setUp(self):
se... | true | true |
f716e10b6e71953481b66f47f8b43c293e3fae0b | 321 | py | Python | wrench/labelmodel/__init__.py | rpryzant/wrench | 3668c359aeff18724e927a207a85da17f2ead823 | [
"Apache-2.0"
] | 1 | 2021-11-24T04:01:08.000Z | 2021-11-24T04:01:08.000Z | wrench/labelmodel/__init__.py | yinkaiw/wrench | f20135eb9b1d51b5bad92b3a910efd92235df356 | [
"Apache-2.0"
] | null | null | null | wrench/labelmodel/__init__.py | yinkaiw/wrench | f20135eb9b1d51b5bad92b3a910efd92235df356 | [
"Apache-2.0"
] | null | null | null | from .dawid_skene import DawidSkene
from .flyingsquid import FlyingSquid
from .generative_model import GenerativeModel
from .gold import GoldCondProb
from .majority_voting import MajorityVoting, MajorityWeightedVoting
from .metal import MeTaL
from .naive_bayes import NaiveBayesModel
from .snorkel import Snorkel
... | 35.666667 | 68 | 0.844237 | from .dawid_skene import DawidSkene
from .flyingsquid import FlyingSquid
from .generative_model import GenerativeModel
from .gold import GoldCondProb
from .majority_voting import MajorityVoting, MajorityWeightedVoting
from .metal import MeTaL
from .naive_bayes import NaiveBayesModel
from .snorkel import Snorkel
... | true | true |
f716e2ca2dbea9c8c4a6ac6e99b6f76798d9cf6c | 3,733 | py | Python | python/bot_discord.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | 1 | 2020-10-06T01:20:07.000Z | 2020-10-06T01:20:07.000Z | python/bot_discord.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | python/bot_discord.py | angelopassaro/Hacktoberfest-1 | 21f90f5d49efba9b1a27f4d9b923f5017ab43f0e | [
"Apache-2.0"
] | null | null | null | "create by poomipat01"
import asyncio
import discord
import youtube_dl
import os
from discord.ext import commands
def read_token():
with open("token.ini",'r') as f:
lines = f.readline()
return lines.strip()
# Suppress noise about console usage from errors
youtube_dl.utils.bug_reports_message = l... | 30.104839 | 107 | 0.639432 |
import asyncio
import discord
import youtube_dl
import os
from discord.ext import commands
def read_token():
with open("token.ini",'r') as f:
lines = f.readline()
return lines.strip()
youtube_dl.utils.bug_reports_message = lambda: ''
TOKEN = os.environ['TOKEN']
ytdl_format_options = {
'form... | true | true |
f716e5b3df3c3c98ce55161f28ad6090b87813a0 | 602 | py | Python | quickstart/python/sms/example-2/send_notifications.6.x.py | Tshisuaka/api-snippets | 52b50037d4af0f3b96adf76197964725a1501e96 | [
"MIT"
] | 234 | 2016-01-27T03:04:38.000Z | 2022-02-25T20:13:43.000Z | quickstart/python/sms/example-2/send_notifications.6.x.py | Tshisuaka/api-snippets | 52b50037d4af0f3b96adf76197964725a1501e96 | [
"MIT"
] | 351 | 2016-04-06T16:55:33.000Z | 2022-03-10T18:42:36.000Z | quickstart/python/sms/example-2/send_notifications.6.x.py | Tshisuaka/api-snippets | 52b50037d4af0f3b96adf76197964725a1501e96 | [
"MIT"
] | 494 | 2016-03-30T15:28:20.000Z | 2022-03-28T19:39:36.000Z | # /usr/bin/env python
# Download the twilio-python library from twilio.com/docs/libraries/python
import os
from twilio.rest import Client
# Find these values at https://twilio.com/user/account
# To set up environmental variables, see http://twil.io/secure
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = "YY... | 33.444444 | 74 | 0.727575 | import os
from twilio.rest import Client
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = "YYYYYYYYYYYYYYYYYY"
client = Client(account_sid, auth_token)
message = client.api.account.messages.create(
to="+12316851234",
from_="+15555555555",
body="Hello there!",
media_url=['https://demo.twilio... | true | true |
f716e7003ce379bfc28bec594685939ffeb73fea | 1,069 | py | Python | award/migrations/0003_rating.py | EmmanuelMuchiri/Awards | d786689a6f5f32532d005ef6a50eed4600ba5ecc | [
"MIT"
] | null | null | null | award/migrations/0003_rating.py | EmmanuelMuchiri/Awards | d786689a6f5f32532d005ef6a50eed4600ba5ecc | [
"MIT"
] | 5 | 2020-06-05T22:45:28.000Z | 2021-09-08T01:16:58.000Z | award/migrations/0003_rating.py | EmmanuelMuchiri/Awards | d786689a6f5f32532d005ef6a50eed4600ba5ecc | [
"MIT"
] | 3 | 2019-09-09T08:16:01.000Z | 2019-11-25T11:37:58.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.24 on 2019-09-07 12:47
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('award', '0002_project'),
]
operations = [
... | 36.862069 | 114 | 0.615529 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('award', '0002_project'),
]
operations = [
migrations.CreateModel(
name='Rating',
fields=[
... | true | true |
f716e8fadfc4a02237cc5c211b47dc9372ec31ac | 4,293 | py | Python | salamanca/cli.py | coroa/salamanca | 29da72cc40dd511c81bfdcb71ac956a24de1148b | [
"Apache-2.0"
] | null | null | null | salamanca/cli.py | coroa/salamanca | 29da72cc40dd511c81bfdcb71ac956a24de1148b | [
"Apache-2.0"
] | null | null | null | salamanca/cli.py | coroa/salamanca | 29da72cc40dd511c81bfdcb71ac956a24de1148b | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
from salamanca import data
from salamanca import currency
COMMANDS = {}
#
# Download wb data
#
def download_wb_cli(parser):
log = 'Print log output during download.'
parser.add_argument('--log', help=log, action="store_true")
overwrite = 'Overwrite local files if they exi... | 25.553571 | 81 | 0.623107 | import argparse
import logging
from salamanca import data
from salamanca import currency
COMMANDS = {}
def download_wb_cli(parser):
log = 'Print log output during download.'
parser.add_argument('--log', help=log, action="store_true")
overwrite = 'Overwrite local files if they exist.'
parser.add_arg... | true | true |
f716ea6ba7a5521a99b2eb2280b6736549b4ed5d | 1,648 | py | Python | src/tests/unit/common/test_css.py | td00/pretalx | aff450de9420fca167e04345fa24ee7140fae819 | [
"Apache-2.0"
] | null | null | null | src/tests/unit/common/test_css.py | td00/pretalx | aff450de9420fca167e04345fa24ee7140fae819 | [
"Apache-2.0"
] | null | null | null | src/tests/unit/common/test_css.py | td00/pretalx | aff450de9420fca167e04345fa24ee7140fae819 | [
"Apache-2.0"
] | null | null | null | import pytest
from django.core.exceptions import ValidationError
from pretalx.common.css import validate_css
from pretalx.event.models import Event
@pytest.fixture
def valid_css():
return '''
body {
background-color: #000;
display: none;
}
.some-descriptor {
border-style: dotted dashed solid double;
BORD... | 22.888889 | 66 | 0.711772 | import pytest
from django.core.exceptions import ValidationError
from pretalx.common.css import validate_css
from pretalx.event.models import Event
@pytest.fixture
def valid_css():
return '''
body {
background-color: #000;
display: none;
}
.some-descriptor {
border-style: dotted dashed solid double;
BORD... | true | true |
f716ec2ee533f960f1e83f092c89ca170e08c6c2 | 679 | py | Python | bin/django-admin.py | hkolstee/bachelor-project | 5d26632c2d920327248efdabf2acc53781264dc2 | [
"MIT"
] | null | null | null | bin/django-admin.py | hkolstee/bachelor-project | 5d26632c2d920327248efdabf2acc53781264dc2 | [
"MIT"
] | null | null | null | bin/django-admin.py | hkolstee/bachelor-project | 5d26632c2d920327248efdabf2acc53781264dc2 | [
"MIT"
] | null | null | null | #!/home/hkolstee/bproject/virtenv/bin/python
# When the django-admin.py deprecation ends, remove this script.
import warnings
from django.core import management
try:
from django.utils.deprecation import RemovedInDjango40Warning
except ImportError:
raise ImportError(
'django-admin.py was deprecated in ... | 30.863636 | 80 | 0.726068 | import warnings
from django.core import management
try:
from django.utils.deprecation import RemovedInDjango40Warning
except ImportError:
raise ImportError(
'django-admin.py was deprecated in Django 3.1 and removed in Django '
'4.0. Please manually remove this script from your virtual environm... | true | true |
f716ecc7b5dee823c09a28bd380274cc0c0c6946 | 2,069 | py | Python | ros/src/twist_controller/twist_controller.py | gradient100/Capstone | 9a4a5fdc22a994b1cfdbef19b66fcb4c5b3b562e | [
"MIT"
] | null | null | null | ros/src/twist_controller/twist_controller.py | gradient100/Capstone | 9a4a5fdc22a994b1cfdbef19b66fcb4c5b3b562e | [
"MIT"
] | null | null | null | ros/src/twist_controller/twist_controller.py | gradient100/Capstone | 9a4a5fdc22a994b1cfdbef19b66fcb4c5b3b562e | [
"MIT"
] | null | null | null | import rospy
from pid import PID
from yaw_controller import YawController
from lowpass import LowPassFilter
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self, vehicle_mass, fuel_capacity, brake_deadband, decel_limit, accel_limit, wheel_radius, wheel_base, steer_ratio, max_lat_acce... | 32.84127 | 221 | 0.760754 | import rospy
from pid import PID
from yaw_controller import YawController
from lowpass import LowPassFilter
GAS_DENSITY = 2.858
ONE_MPH = 0.44704
class Controller(object):
def __init__(self, vehicle_mass, fuel_capacity, brake_deadband, decel_limit, accel_limit, wheel_radius, wheel_base, steer_ratio, max_lat_acce... | false | true |
f716ece959d936bd66bf82233eb4b71aa5c73834 | 2,091 | py | Python | quant/utils/dingding.py | tianhm/TheNextQuant | a0d062fe8160088118b128d757d01b396c129680 | [
"MIT"
] | 1 | 2020-03-24T02:19:20.000Z | 2020-03-24T02:19:20.000Z | quant/utils/dingding.py | tianhm/TheNextQuant | a0d062fe8160088118b128d757d01b396c129680 | [
"MIT"
] | null | null | null | quant/utils/dingding.py | tianhm/TheNextQuant | a0d062fe8160088118b128d757d01b396c129680 | [
"MIT"
] | 5 | 2019-08-12T09:40:27.000Z | 2022-01-26T07:36:24.000Z | # -*- coding:utf-8 -*-
"""
钉钉机器人接口
Author: HuangTao
Date: 2018/08/04
Update: 2018/12/24 1. 增加markdown格式消息推送;
"""
from quant.utils import logger
from quant.utils.http_client import AsyncHttpRequests
class DingTalk:
""" 钉钉机器人接口
"""
BASE_URL = 'https://oapi.dingtalk.com/robot/send?access_token='
@... | 30.304348 | 94 | 0.568149 |
from quant.utils import logger
from quant.utils.http_client import AsyncHttpRequests
class DingTalk:
BASE_URL = 'https://oapi.dingtalk.com/robot/send?access_token='
@classmethod
async def send_text_msg(cls, access_token, content, phones=None, is_at_all=False):
body = {
'msgtype': 't... | true | true |
f716ed7302b9f41211156c88b591db55e8d6fd9c | 5,726 | py | Python | threedi_api_client/openapi/models/inline_response20068.py | nens/threedi-api-client | 43b0eb1bd47310b1783f87f6ad8bfbfe0fb4d90a | [
"BSD-3-Clause"
] | null | null | null | threedi_api_client/openapi/models/inline_response20068.py | nens/threedi-api-client | 43b0eb1bd47310b1783f87f6ad8bfbfe0fb4d90a | [
"BSD-3-Clause"
] | 16 | 2021-05-31T09:52:04.000Z | 2022-03-14T16:07:19.000Z | threedi_api_client/openapi/models/inline_response20068.py | nens/threedi-api-client | 43b0eb1bd47310b1783f87f6ad8bfbfe0fb4d90a | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
3Di API
3Di simulation API (latest stable version: v3) Framework release: 2.9.0 3Di core release: 2.2.2 deployed on: 11:01AM (UTC) on January 11, 2022 # noqa: E501
The version of the OpenAPI document: v3
Contact: info@nelen-schuurmans.nl
Generated by: https://openapi-ge... | 28.346535 | 166 | 0.59029 |
import logging
import pprint
import re
import six
from threedi_api_client.openapi.configuration import Configuration
logger = logging.getLogger(__name__)
class InlineResponse20068(object):
openapi_types = {
'count': 'int',
'next': 'str',
'previous': 'str',
'results': 'list[T... | true | true |
f716eee3eb58697b715967ba75f76f3d236c3384 | 3,353 | py | Python | minigrid_basics/examples/rw_four_directions.py | dumpmemory/google-research | bc87d010ab9086b6e92c3f075410fa6e1f27251b | [
"Apache-2.0"
] | null | null | null | minigrid_basics/examples/rw_four_directions.py | dumpmemory/google-research | bc87d010ab9086b6e92c3f075410fa6e1f27251b | [
"Apache-2.0"
] | null | null | null | minigrid_basics/examples/rw_four_directions.py | dumpmemory/google-research | bc87d010ab9086b6e92c3f075410fa6e1f27251b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | 31.632075 | 92 | 0.737548 |
import os
from absl import app
from absl import flags
import gin
import gym
import gym_minigrid from gym_minigrid.wrappers import RGBImgObsWrapper
import matplotlib.pylab as plt
import tensorflow as tf
from minigrid_basics.custom_wrappers import tabular_wrapper from minigrid_basics.envs import mon_minigrid
FLAG... | true | true |
f716ef059d911c1ddacddb527c6766ef71f00589 | 3,623 | py | Python | scripts/run_mots_depth_inference.py | VladimirYugay/diw | d1a760f1911e9d09fbe038abffc3aa76d384f86a | [
"MIT"
] | 1 | 2021-09-14T21:24:56.000Z | 2021-09-14T21:24:56.000Z | scripts/run_mots_depth_inference.py | VladimirYugay/diw | d1a760f1911e9d09fbe038abffc3aa76d384f86a | [
"MIT"
] | null | null | null | scripts/run_mots_depth_inference.py | VladimirYugay/diw | d1a760f1911e9d09fbe038abffc3aa76d384f86a | [
"MIT"
] | null | null | null | """ Script for running depth inference assuming MOTS dataset structure """
import logging
import os
import sys
from pathlib import Path, PurePath
import click
import matplotlib.pyplot as plt
import numpy as np
import tensorflow.compat.v1 as tf
from IPython.core import ultratb
from PIL import Image
import diw
from diw... | 32.348214 | 86 | 0.606956 | import logging
import os
import sys
from pathlib import Path, PurePath
import click
import matplotlib.pyplot as plt
import numpy as np
import tensorflow.compat.v1 as tf
from IPython.core import ultratb
from PIL import Image
import diw
from diw.model import Model, get_vars_to_save_and_restore
sys.excepthook = ultratb... | true | true |
f716f00b794214b6366e86f868a33212f28fca85 | 2,250 | py | Python | custom_components/nintendo_wishlist/__init__.py | custom-components/sensor.nintendo_wishlis | 6709a5c1b6e323494e7449fa1ac24e61100fc302 | [
"Apache-2.0"
] | 13 | 2020-05-07T21:31:51.000Z | 2022-02-09T01:53:53.000Z | custom_components/nintendo_wishlist/__init__.py | custom-components/sensor.nintendo_wishlis | 6709a5c1b6e323494e7449fa1ac24e61100fc302 | [
"Apache-2.0"
] | 19 | 2019-07-24T08:10:06.000Z | 2022-02-05T04:09:34.000Z | custom_components/nintendo_wishlist/__init__.py | custom-components/sensor.nintendo_wishlis | 6709a5c1b6e323494e7449fa1ac24e61100fc302 | [
"Apache-2.0"
] | 5 | 2019-12-13T17:48:52.000Z | 2020-07-06T07:45:31.000Z | """Nintendo Wishlist integration."""
import logging
import voluptuous as vol
from homeassistant import core
from homeassistant.const import CONF_SCAN_INTERVAL
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.discov... | 33.58209 | 88 | 0.699556 | import logging
import voluptuous as vol
from homeassistant import core
from homeassistant.const import CONF_SCAN_INTERVAL
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.discovery import async_load_platform
from h... | true | true |
f716f19491be0a8291d501ec3e6e2ae018304842 | 5,052 | py | Python | code/lib/warn/search/malicious_behaviours/telephony_identifiers.py | JaspervanRooijen/covid-apps-observer | 59f6049a493c80797d83fd24e4a4789a14f3110e | [
"MIT"
] | null | null | null | code/lib/warn/search/malicious_behaviours/telephony_identifiers.py | JaspervanRooijen/covid-apps-observer | 59f6049a493c80797d83fd24e4a4789a14f3110e | [
"MIT"
] | null | null | null | code/lib/warn/search/malicious_behaviours/telephony_identifiers.py | JaspervanRooijen/covid-apps-observer | 59f6049a493c80797d83fd24e4a4789a14f3110e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of Androwarn.
#
# Copyright (C) 2012, 2019, Thomas Debize <tdebize at mail.com>
# All rights reserved.
#
# Androwarn is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
#... | 54.322581 | 195 | 0.66825 |
import logging
from lib.warn.util.util import *
log = logging.getLogger('log')
def detect_telephony_gsm_GsmCellLocation(x):
method_listing = [
("getLac()", "This application reads the Location Area Code value"),
("getCid()", "This application reads the Cell ID value")
]
... | true | true |
f716f2899ec4b9277a6cd89d3948a14978b46dc3 | 4,763 | py | Python | izi_shipping/packers.py | izi-ecommerce/izi-shipping | 863dc84ad73a2e1413b3ef8043af3ac87fa5cdb9 | [
"BSD-3-Clause"
] | null | null | null | izi_shipping/packers.py | izi-ecommerce/izi-shipping | 863dc84ad73a2e1413b3ef8043af3ac87fa5cdb9 | [
"BSD-3-Clause"
] | null | null | null | izi_shipping/packers.py | izi-ecommerce/izi-shipping | 863dc84ad73a2e1413b3ef8043af3ac87fa5cdb9 | [
"BSD-3-Clause"
] | null | null | null | from decimal import Decimal as D
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext_lazy as _
from izi.core import loading
Scale = loading.get_class('shipping.scales', 'Scale')
weight_precision = getattr(
settings, 'IZI_SHIPPING_W... | 35.81203 | 107 | 0.617888 | from decimal import Decimal as D
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.utils.translation import ugettext_lazy as _
from izi.core import loading
Scale = loading.get_class('shipping.scales', 'Scale')
weight_precision = getattr(
settings, 'IZI_SHIPPING_W... | true | true |
f716f32b4db4b79169801db929ce86099f51f34b | 564 | py | Python | hw4/part3/table_printer.py | jonescarissa/csc221 | 1052b4cf9f3aab86c063c1b3845895a590bc2083 | [
"CC0-1.0"
] | null | null | null | hw4/part3/table_printer.py | jonescarissa/csc221 | 1052b4cf9f3aab86c063c1b3845895a590bc2083 | [
"CC0-1.0"
] | null | null | null | hw4/part3/table_printer.py | jonescarissa/csc221 | 1052b4cf9f3aab86c063c1b3845895a590bc2083 | [
"CC0-1.0"
] | 1 | 2021-09-02T03:55:17.000Z | 2021-09-02T03:55:17.000Z | ''' Table Printer practice project
Author: Carissa Jones
'''
tableData = [['I', 'out', 'chair.'],
['just', 'of', 'Im'],
['fell', 'my', 'fine.']]
def printTable(tableData):
'''Given list of strings, tableData, displays in a well-organized
table with each column right-justified'... | 23.5 | 69 | 0.56383 |
tableData = [['I', 'out', 'chair.'],
['just', 'of', 'Im'],
['fell', 'my', 'fine.']]
def printTable(tableData):
colWidths = [0] * len(tableData)
for x in range(len(tableData[0])):
for y in range(len(colWidths)):
print(tableData[y][x].rjust(colWidths[y]), end= '... | true | true |
f716f342dfdde7c09452213431f486564cd316b0 | 20,293 | py | Python | blender/arm/lightmapper/utility/encoding.py | onelsonic/armory | 55cfead0844923d419d75bf4bd677ebed714b4b5 | [
"Zlib"
] | 2,583 | 2016-07-27T08:25:47.000Z | 2022-03-31T10:42:17.000Z | blender/arm/lightmapper/utility/encoding.py | onelsonic/armory | 55cfead0844923d419d75bf4bd677ebed714b4b5 | [
"Zlib"
] | 2,122 | 2016-07-31T14:20:04.000Z | 2022-03-31T20:44:14.000Z | blender/arm/lightmapper/utility/encoding.py | onelsonic/armory | 55cfead0844923d419d75bf4bd677ebed714b4b5 | [
"Zlib"
] | 451 | 2016-08-12T05:52:58.000Z | 2022-03-31T01:33:07.000Z | import bpy, math, os, gpu, bgl
import numpy as np
from . import utility
from fractions import Fraction
from gpu_extras.batch import batch_for_shader
def encodeLogLuvGPU(image, outDir, quality):
input_image = bpy.data.images[image.name]
image_name = input_image.name
offscreen = gpu.types.GPUOffScreen(input... | 31.51087 | 123 | 0.588824 | import bpy, math, os, gpu, bgl
import numpy as np
from . import utility
from fractions import Fraction
from gpu_extras.batch import batch_for_shader
def encodeLogLuvGPU(image, outDir, quality):
input_image = bpy.data.images[image.name]
image_name = input_image.name
offscreen = gpu.types.GPUOffScreen(input... | true | true |
f716f3a29096b6b3d1684fa66a9f8119736e670b | 468 | py | Python | contentcuration/contentcuration/migrations/0015_auto_20160914_1640.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 1 | 2019-03-30T18:14:25.000Z | 2019-03-30T18:14:25.000Z | contentcuration/contentcuration/migrations/0015_auto_20160914_1640.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 4 | 2016-05-06T17:19:30.000Z | 2019-03-15T01:51:24.000Z | contentcuration/contentcuration/migrations/0015_auto_20160914_1640.py | Tlazypanda/studio | cd1c2f169c705027cdd808cbbcae907d0a9b21d2 | [
"MIT"
] | 4 | 2016-10-18T22:49:08.000Z | 2019-09-17T11:20:51.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-14 23:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0014_channel_language'),
]
operations = [
migrations.Alte... | 22.285714 | 58 | 0.623932 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0014_channel_language'),
]
operations = [
migrations.AlterField(
model_name='channel',
name='thumbnail',
... | true | true |
f716f3b18a7254d8f31a8cfae36f39274adaf28e | 815 | py | Python | src/code/sort_clique_data_by_size.py | Buddyboy201/clique_analysis | 9e7fd9acb2aba8cf3ced0b0ddb3d11ebc74734fb | [
"MIT"
] | null | null | null | src/code/sort_clique_data_by_size.py | Buddyboy201/clique_analysis | 9e7fd9acb2aba8cf3ced0b0ddb3d11ebc74734fb | [
"MIT"
] | null | null | null | src/code/sort_clique_data_by_size.py | Buddyboy201/clique_analysis | 9e7fd9acb2aba8cf3ced0b0ddb3d11ebc74734fb | [
"MIT"
] | null | null | null | import json
#top 50 all cliques in category
#top 50 size n till n=2 in category
def update_ref(data, ref):
for clique_str, count in data:
clique = eval(clique_str)
if ref.get(len(clique)) is None:
ref[len(clique)] = []
ref[len(clique)].append((clique, count))
return ref
wi... | 32.6 | 73 | 0.628221 | import json
def update_ref(data, ref):
for clique_str, count in data:
clique = eval(clique_str)
if ref.get(len(clique)) is None:
ref[len(clique)] = []
ref[len(clique)].append((clique, count))
return ref
with open("clique_data.json", "r") as data_file:
data = json.load(... | true | true |
f716f3fadbdd20212933b188540902a9450b91e8 | 6,260 | py | Python | pimsviewer/dimension.py | soft-matter/pimsviewer | 9263ece121a58a0504c6e4d319ec6e18d1bb460a | [
"BSD-3-Clause"
] | 9 | 2018-06-26T06:49:34.000Z | 2022-03-01T19:54:56.000Z | pimsviewer/dimension.py | soft-matter/pimsviewer | 9263ece121a58a0504c6e4d319ec6e18d1bb460a | [
"BSD-3-Clause"
] | 14 | 2017-03-02T17:34:08.000Z | 2020-06-23T15:09:23.000Z | pimsviewer/dimension.py | soft-matter/pimsviewer | 9263ece121a58a0504c6e4d319ec6e18d1bb460a | [
"BSD-3-Clause"
] | 6 | 2017-03-02T18:36:20.000Z | 2020-11-22T23:27:14.000Z | import os
import numpy as np
from PyQt5 import uic
from PyQt5.QtCore import QDir, Qt, QTimer, pyqtSignal
from PyQt5.QtGui import QImage, QPainter, QPalette, QPixmap
from PyQt5.QtWidgets import (QHBoxLayout, QSlider, QWidget, QAction, QApplication, QFileDialog, QLabel, QMainWindow, QMenu, QMessageBox, QScrollArea, QSize... | 27.099567 | 257 | 0.616613 | import os
import numpy as np
from PyQt5 import uic
from PyQt5.QtCore import QDir, Qt, QTimer, pyqtSignal
from PyQt5.QtGui import QImage, QPainter, QPalette, QPixmap
from PyQt5.QtWidgets import (QHBoxLayout, QSlider, QWidget, QAction, QApplication, QFileDialog, QLabel, QMainWindow, QMenu, QMessageBox, QScrollArea, QSize... | true | true |
f716f40ff8616b758469bb436739279671f60ee1 | 327 | py | Python | deform_conv/utils.py | lone17/deform-conv | 3502cedbeae61c961d7e988382c55b9d45fd1873 | [
"MIT"
] | 221 | 2017-03-30T12:31:02.000Z | 2022-03-24T08:39:26.000Z | deform_conv/utils.py | ml-lab/deform-conv | 126ebcc283a4325c474332fa170f57d52a59e34d | [
"MIT"
] | 1 | 2019-03-09T11:01:39.000Z | 2019-03-09T11:01:39.000Z | deform_conv/utils.py | ml-lab/deform-conv | 126ebcc283a4325c474332fa170f57d52a59e34d | [
"MIT"
] | 78 | 2017-03-30T21:46:59.000Z | 2022-03-19T19:52:19.000Z | from __future__ import absolute_import, division
from tensorflow.python import debug as tf_debug
import keras.backend as K
def keras_set_tf_debug():
sess = K.get_session()
sess = tf_debug.LocalCLIDebugWrapperSession(sess)
sess.add_tensor_filter("has_inf_or_nan", tf_debug.has_inf_or_nan)
K.set_session... | 27.25 | 69 | 0.788991 | from __future__ import absolute_import, division
from tensorflow.python import debug as tf_debug
import keras.backend as K
def keras_set_tf_debug():
sess = K.get_session()
sess = tf_debug.LocalCLIDebugWrapperSession(sess)
sess.add_tensor_filter("has_inf_or_nan", tf_debug.has_inf_or_nan)
K.set_session... | true | true |
f716f5a922081969766e4529bf89d92758cc2879 | 11,057 | py | Python | runway/aws_sso_botocore/credentials.py | avosper-intellaegis/runway | 757d4e7db269ec16479b044ac82a69f25fa2a450 | [
"Apache-2.0"
] | null | null | null | runway/aws_sso_botocore/credentials.py | avosper-intellaegis/runway | 757d4e7db269ec16479b044ac82a69f25fa2a450 | [
"Apache-2.0"
] | null | null | null | runway/aws_sso_botocore/credentials.py | avosper-intellaegis/runway | 757d4e7db269ec16479b044ac82a69f25fa2a450 | [
"Apache-2.0"
] | null | null | null | """Botocore with support for AWS SSO credential assets."""
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http:... | 35.213376 | 88 | 0.665823 | import datetime
import json
import logging
import os
from hashlib import sha1
from botocore import UNSIGNED
from botocore.config import Config
from botocore.credentials import (
AssumeRoleProvider,
BotoProvider,
CachedCredentialFetcher,
CanonicalNameCredentialSourcer,
ContainerProvider,
Credent... | true | true |
f716f72e90955ad7a4275213b789b78de850af13 | 5,819 | py | Python | storm_control/sc_hardware/hamamatsu/io_tests.py | shiwei23/STORM6 | 669067503ebd164b575ce529fcc4a9a3f576b3d7 | [
"MIT"
] | 47 | 2015-02-11T16:05:54.000Z | 2022-03-26T14:13:12.000Z | storm_control/sc_hardware/hamamatsu/io_tests.py | shiwei23/STORM6 | 669067503ebd164b575ce529fcc4a9a3f576b3d7 | [
"MIT"
] | 110 | 2015-01-30T03:53:41.000Z | 2021-11-03T15:58:44.000Z | storm_control/sc_hardware/hamamatsu/io_tests.py | shiwei23/STORM6 | 669067503ebd164b575ce529fcc4a9a3f576b3d7 | [
"MIT"
] | 61 | 2015-01-09T18:31:27.000Z | 2021-12-21T13:07:51.000Z | #!/usr/bin/python
#
## @file
#
# For testing how to write 2048 x 2048 pixels at 100fps.
#
# Hazen 10/13
#
import ctypes
import ctypes.util
import numpy
import time
import hamamatsu_camera as hc
print "camera 0 model:", hc.getModelInfo(0)
hcam = hc.HamamatsuCameraMR(0)
# Set camera parameters.
... | 28.247573 | 113 | 0.598556 |
import ctypes
import ctypes.util
import numpy
import time
import hamamatsu_camera as hc
print "camera 0 model:", hc.getModelInfo(0)
hcam = hc.HamamatsuCameraMR(0)
cam_offset = 100
cam_x = 2048
cam_y = 2048
hcam.setPropertyValue("defect_correct_mode", "OFF")
hcam.setPropertyValue("exposure_time", 0.... | false | true |
f716f787333a832b615b0a6c98f4f3cf3223b40f | 148 | py | Python | _config.py | atourkow/at-InAppScoring | 6603a0b7bce7d456620d760f5a06e5b0f0dc2a90 | [
"Apache-2.0"
] | null | null | null | _config.py | atourkow/at-InAppScoring | 6603a0b7bce7d456620d760f5a06e5b0f0dc2a90 | [
"Apache-2.0"
] | null | null | null | _config.py | atourkow/at-InAppScoring | 6603a0b7bce7d456620d760f5a06e5b0f0dc2a90 | [
"Apache-2.0"
] | null | null | null |
class Config(object):
def __init__(self):
self.servers = [
"127.0.0.1"
]
self.keyspace = 'at_inappscoring'
| 18.5 | 41 | 0.513514 |
class Config(object):
def __init__(self):
self.servers = [
"127.0.0.1"
]
self.keyspace = 'at_inappscoring'
| true | true |
f716f8c015aff41ef3b8ac361688f47dbb0587ed | 860 | py | Python | app/models.py | imireallan/Bucketlist | 2dc496cf866d6b21594f9bd7efd12af43ee77cba | [
"MIT"
] | null | null | null | app/models.py | imireallan/Bucketlist | 2dc496cf866d6b21594f9bd7efd12af43ee77cba | [
"MIT"
] | null | null | null | app/models.py | imireallan/Bucketlist | 2dc496cf866d6b21594f9bd7efd12af43ee77cba | [
"MIT"
] | null | null | null | # app/models.py
from app import db
class Bucketlist(db.Model):
"""This class represents the bucketlist table."""
__tablename__ = 'bucketlists'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(255))
date_created = db.Column(db.DateTime, default=db.func.current_timestamp())
... | 25.294118 | 78 | 0.636047 |
from app import db
class Bucketlist(db.Model):
__tablename__ = 'bucketlists'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(255))
date_created = db.Column(db.DateTime, default=db.func.current_timestamp())
date_modified = db.Column(
db.DateTime, default=db.func.cu... | true | true |
f716fa1463f1193d4ff8966502c6b97695669997 | 5,056 | py | Python | tf2_ndg_benckmarks/metrics/embedding.py | katsugeneration/tf2-ndg-benchmarks | ba2d07ef997fac87b3991a54c0a234f7c5425b0f | [
"MIT"
] | 1 | 2020-11-17T07:03:47.000Z | 2020-11-17T07:03:47.000Z | tf2_ndg_benckmarks/metrics/embedding.py | katsugeneration/tf2-ndg-benchmarks | ba2d07ef997fac87b3991a54c0a234f7c5425b0f | [
"MIT"
] | null | null | null | tf2_ndg_benckmarks/metrics/embedding.py | katsugeneration/tf2-ndg-benchmarks | ba2d07ef997fac87b3991a54c0a234f7c5425b0f | [
"MIT"
] | null | null | null | """
Copyright:
Copyright 2019 by Katsuya SHIMABUKURO.
License:
MIT, see LICENSE for details.
"""
import pathlib
import gzip
import requests
import tqdm
import numpy as np
from gensim.models import KeyedVectors
FILE_ID = '0B7XkCwpI5KDYNlNUTTlSS21pQmM'
SOURCE_URL = 'https://drive.google.com/uc?export=download&i... | 31.798742 | 116 | 0.617089 | import pathlib
import gzip
import requests
import tqdm
import numpy as np
from gensim.models import KeyedVectors
FILE_ID = '0B7XkCwpI5KDYNlNUTTlSS21pQmM'
SOURCE_URL = 'https://drive.google.com/uc?export=download&id={file_id}'
SOURCE_URL_WITH_CONFIRM = 'https://drive.google.com/uc?export=download&confirm={code}&id={fi... | true | true |
f716fbfc8df971e7d631e0b0b90237bc351ca7f6 | 11,145 | py | Python | dolo/algos/simulations.py | EconForge/dolo | 9bb75b8f6ea87578393fe748003092ffb745e8d6 | [
"BSD-2-Clause"
] | 50 | 2015-03-16T01:07:00.000Z | 2020-02-07T22:18:43.000Z | dolo/algos/simulations.py | EconForge/dolo | 9bb75b8f6ea87578393fe748003092ffb745e8d6 | [
"BSD-2-Clause"
] | 130 | 2015-01-01T19:33:21.000Z | 2020-04-27T15:57:22.000Z | dolo/algos/simulations.py | EconForge/dolo | 9bb75b8f6ea87578393fe748003092ffb745e8d6 | [
"BSD-2-Clause"
] | 56 | 2015-10-14T12:27:26.000Z | 2020-04-21T14:56:02.000Z | import numpy
import pandas
import xarray as xr
import numpy as np
from dolo.compiler.model import Model
from dolo.numeric.optimize.ncpsolve import ncpsolve
from dolo.numeric.optimize.newton import newton as newton_solver
from dolo.numeric.optimize.newton import SerialDifferentiableFunction
## TODO: extend for mc proc... | 28.286802 | 126 | 0.557649 | import numpy
import pandas
import xarray as xr
import numpy as np
from dolo.compiler.model import Model
from dolo.numeric.optimize.ncpsolve import ncpsolve
from dolo.numeric.optimize.newton import newton as newton_solver
from dolo.numeric.optimize.newton import SerialDifferentiableFunction
def response(model, dr, v... | true | true |
f716fcb9c6975762b9257b5426a806187ac75ac5 | 6,270 | py | Python | python_modules/dagster-airflow/dagster_airflow_tests/conftest.py | vishvananda/dagster | f6aa44714246bc770fe05a9c986fe8b7d848956b | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-airflow/dagster_airflow_tests/conftest.py | vishvananda/dagster | f6aa44714246bc770fe05a9c986fe8b7d848956b | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-airflow/dagster_airflow_tests/conftest.py | vishvananda/dagster | f6aa44714246bc770fe05a9c986fe8b7d848956b | [
"Apache-2.0"
] | null | null | null | # pylint doesn't understand the way that pytest constructs fixture dependnecies
# pylint: disable=redefined-outer-name
import datetime
import os
import shutil
import subprocess
import sys
import tempfile
import uuid
import airflow.plugins_manager
import docker
import pytest
from dagster import check
from dagster.core... | 29.299065 | 100 | 0.693461 | # pylint: disable=redefined-outer-name
import datetime
import os
import shutil
import subprocess
import sys
import tempfile
import uuid
import airflow.plugins_manager
import docker
import pytest
from dagster import check
from dagster.core.execution import create_execution_plan
from dagster.utils import load_yaml_from... | true | true |
f716fd7bd67ce55c0a030c87f0370590bbe380cb | 223 | py | Python | tablas_multiplicar.py | robertogonzalezp/X-Serv-Python-Multiplica | d262184c12217ebdfd3bc8f4a3fccc99496fcaa2 | [
"Apache-2.0"
] | null | null | null | tablas_multiplicar.py | robertogonzalezp/X-Serv-Python-Multiplica | d262184c12217ebdfd3bc8f4a3fccc99496fcaa2 | [
"Apache-2.0"
] | null | null | null | tablas_multiplicar.py | robertogonzalezp/X-Serv-Python-Multiplica | d262184c12217ebdfd3bc8f4a3fccc99496fcaa2 | [
"Apache-2.0"
] | null | null | null | for numero1 in range(1, 11):
print('\n', "Tabla del " + str(numero1))
print("--------------")
for numero2 in range(1, 11):
print(str(numero1) + " por " + str(numero2) + " es " + str(numero1 * numero2)) | 31.857143 | 86 | 0.520179 | for numero1 in range(1, 11):
print('\n', "Tabla del " + str(numero1))
print("--------------")
for numero2 in range(1, 11):
print(str(numero1) + " por " + str(numero2) + " es " + str(numero1 * numero2)) | true | true |
f716fda140000ae4d4422e93bc1747b5025d820d | 933 | py | Python | aioredis_opentracing/instrument.py | Creativelair/AIORedis-Opentracing | eebf81785052faddaec8c00da74c862bbeeafdf9 | [
"BSD-3-Clause"
] | null | null | null | aioredis_opentracing/instrument.py | Creativelair/AIORedis-Opentracing | eebf81785052faddaec8c00da74c862bbeeafdf9 | [
"BSD-3-Clause"
] | 1 | 2020-10-09T20:23:40.000Z | 2020-10-09T20:23:40.000Z | aioredis_opentracing/instrument.py | Creativelair/AIORedis-Opentracing | eebf81785052faddaec8c00da74c862bbeeafdf9 | [
"BSD-3-Clause"
] | null | null | null | import opentracing
from signalfx_tracing import utils
from wrapt import wrap_function_wrapper
from aioredis_opentracing import tracing
config = utils.Config(
tracer=None,
)
def instrument(tracer=None):
aioredis = utils.get_module('aioredis')
if utils.is_instrumented(aioredis):
return
tracin... | 25.916667 | 78 | 0.738478 | import opentracing
from signalfx_tracing import utils
from wrapt import wrap_function_wrapper
from aioredis_opentracing import tracing
config = utils.Config(
tracer=None,
)
def instrument(tracer=None):
aioredis = utils.get_module('aioredis')
if utils.is_instrumented(aioredis):
return
tracin... | true | true |
f716fdec7574c7c1759ea315c98291d9a23d5771 | 2,751 | py | Python | tests/di/core/test_instance.py | dlski/python-di | 04dcdf58f3cf820e2d2ba5086e4e89822ae1f409 | [
"MIT"
] | 8 | 2021-02-05T16:17:31.000Z | 2022-03-03T00:01:33.000Z | tests/di/core/test_instance.py | dlski/python-di | 04dcdf58f3cf820e2d2ba5086e4e89822ae1f409 | [
"MIT"
] | null | null | null | tests/di/core/test_instance.py | dlski/python-di | 04dcdf58f3cf820e2d2ba5086e4e89822ae1f409 | [
"MIT"
] | null | null | null | import pytest
from di.core.compose import ApplicationComposer, ComposedApplication
from di.core.element import Element
from di.core.injection import InjectionSolver
from di.core.instance import (
ApplicationInstanceElementNotFound,
RecursiveApplicationInstance,
RecursiveApplicationInstanceBuilder,
Recu... | 30.230769 | 88 | 0.751 | import pytest
from di.core.compose import ApplicationComposer, ComposedApplication
from di.core.element import Element
from di.core.injection import InjectionSolver
from di.core.instance import (
ApplicationInstanceElementNotFound,
RecursiveApplicationInstance,
RecursiveApplicationInstanceBuilder,
Recu... | true | true |
f716fe49497e0fa092b298e9bf377c75b13a12bf | 1,247 | py | Python | servers/python/coweb/auth/public.py | opencoweb/coweb | 7b3a87ee9eda735a859447d404ee16edde1c5671 | [
"AFL-2.1"
] | 83 | 2015-01-05T19:02:57.000Z | 2021-11-19T02:48:09.000Z | servers/python/coweb/auth/public.py | xuelingxiao/coweb | 7b3a87ee9eda735a859447d404ee16edde1c5671 | [
"AFL-2.1"
] | 3 | 2015-12-16T13:49:33.000Z | 2019-06-17T13:38:50.000Z | servers/python/coweb/auth/public.py | xuelingxiao/coweb | 7b3a87ee9eda735a859447d404ee16edde1c5671 | [
"AFL-2.1"
] | 14 | 2015-04-29T22:36:53.000Z | 2021-11-18T03:24:29.000Z | '''
Copyright (c) The Dojo Foundation 2011. All Rights Reserved.
Copyright (c) IBM Corporation 2008, 2011. All Rights Reserved.
'''
from .base import AuthBase
class PublicAuth(AuthBase):
cookieName = 'coweb.auth.public.username'
_userId = 0
def requires_login(self):
'''Does not require login. Usern... | 34.638889 | 80 | 0.642342 | from .base import AuthBase
class PublicAuth(AuthBase):
cookieName = 'coweb.auth.public.username'
_userId = 0
def requires_login(self):
return False
def requires_cookies(self):
return True
def get_current_user(self, handler):
username = handler.get_secure_cookie(sel... | true | true |
f716fedc6fe525ef992c71afd6110e49481a4bad | 566 | py | Python | Python/Tests/TestData/DebuggerProject/EvalPseudoType.py | nanshuiyu/pytools | 9f9271fe8cf564b4f94e9456d400f4306ea77c23 | [
"Apache-2.0"
] | null | null | null | Python/Tests/TestData/DebuggerProject/EvalPseudoType.py | nanshuiyu/pytools | 9f9271fe8cf564b4f94e9456d400f4306ea77c23 | [
"Apache-2.0"
] | null | null | null | Python/Tests/TestData/DebuggerProject/EvalPseudoType.py | nanshuiyu/pytools | 9f9271fe8cf564b4f94e9456d400f4306ea77c23 | [
"Apache-2.0"
] | null | null | null | from ctypes import *
class PyObject(Structure):
_fields_ = [('ob_refcnt', c_size_t),
('ob_type', py_object)]
class PseudoTypeType(object):
def __getattribute__(self, name):
if name == '__repr__':
raise Exception()
elif name == '__name__':
retu... | 25.727273 | 60 | 0.625442 | from ctypes import *
class PyObject(Structure):
_fields_ = [('ob_refcnt', c_size_t),
('ob_type', py_object)]
class PseudoTypeType(object):
def __getattribute__(self, name):
if name == '__repr__':
raise Exception()
elif name == '__name__':
retu... | true | true |
f716ff229a4800b23522336aaaedc9e85c29ccb7 | 1,115 | py | Python | userbot/modules/__init__.py | caerus19/Userator | ff4e6d2461d096d2e9d4c8eda9fdf09d47319a61 | [
"MIT"
] | null | null | null | userbot/modules/__init__.py | caerus19/Userator | ff4e6d2461d096d2e9d4c8eda9fdf09d47319a61 | [
"MIT"
] | null | null | null | userbot/modules/__init__.py | caerus19/Userator | ff4e6d2461d096d2e9d4c8eda9fdf09d47319a61 | [
"MIT"
] | 1 | 2021-11-12T18:00:49.000Z | 2021-11-12T18:00:49.000Z | # U S Σ R Δ T O R / Ümüd
""" U S Σ R Δ T O R """
from userbot import LOGS
from telethon.tl.types import DocumentAttributeFilename
def __list_all_modules():
from os.path import dirname, basename, isfile
import glob
mod_paths = glob.glob(dirname(__file__) + "/*.py")
all_modules = [
basename(f)... | 24.777778 | 101 | 0.675336 |
from userbot import LOGS
from telethon.tl.types import DocumentAttributeFilename
def __list_all_modules():
from os.path import dirname, basename, isfile
import glob
mod_paths = glob.glob(dirname(__file__) + "/*.py")
all_modules = [
basename(f)[:-3] for f in mod_paths
if isfile(f) and... | true | true |
f716ff4ad1f5c83780f6a28d11c0f4b0f33e91fd | 513 | py | Python | happyml/graphs/viz.py | guiferviz/happyml-py | 4252d0cff27461e38da404553772dafbc74f3eaa | [
"BSD-Source-Code"
] | 1 | 2016-08-15T13:27:48.000Z | 2016-08-15T13:27:48.000Z | happyml/graphs/viz.py | guiferviz/happyml-py | 4252d0cff27461e38da404553772dafbc74f3eaa | [
"BSD-Source-Code"
] | null | null | null | happyml/graphs/viz.py | guiferviz/happyml-py | 4252d0cff27461e38da404553772dafbc74f3eaa | [
"BSD-Source-Code"
] | null | null | null |
# FIXME: not required dependency.
from graphviz import Digraph
def graph2dot(x, **kwargs):
dot = Digraph(body=["rankdir=LR;"], **kwargs)
path = x.get_computation_path()
for i in path:
if i.is_input:
dot.node(str(i.id), i.name, color="green")
elif i.is_parameter:
... | 22.304348 | 54 | 0.549708 |
from graphviz import Digraph
def graph2dot(x, **kwargs):
dot = Digraph(body=["rankdir=LR;"], **kwargs)
path = x.get_computation_path()
for i in path:
if i.is_input:
dot.node(str(i.id), i.name, color="green")
elif i.is_parameter:
dot.node(str(i.id), i.name, color=... | true | true |
f716ff4c138f17dceedf81771978e6db1119f04a | 1,758 | py | Python | setup.py | hoogerheide/reductus | fcc78c06900cff89faceadb7b4eed7b87914c0af | [
"Unlicense"
] | 1 | 2021-06-11T19:24:49.000Z | 2021-06-11T19:24:49.000Z | setup.py | hoogerheide/reductus | fcc78c06900cff89faceadb7b4eed7b87914c0af | [
"Unlicense"
] | null | null | null | setup.py | hoogerheide/reductus | fcc78c06900cff89faceadb7b4eed7b87914c0af | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
import sys
import os
from setuptools import setup, find_packages
if len(sys.argv) == 1:
sys.argv.append('install')
if sys.argv[1] == 'test':
from subprocess import call
sys.exit(call([sys.executable, '-m', 'pytest'] + sys.argv[2:]))
# Create the resource file dataflow/git_revision
... | 29.79661 | 76 | 0.631968 | import sys
import os
from setuptools import setup, find_packages
if len(sys.argv) == 1:
sys.argv.append('install')
if sys.argv[1] == 'test':
from subprocess import call
sys.exit(call([sys.executable, '-m', 'pytest'] + sys.argv[2:]))
if os.system('"{sys.executable}" dataflow/rev.py'.format(sys=sys)) != 0... | true | true |
f716ff87b1f5b661462123694cbcb3fe6c7ec595 | 1,524 | py | Python | Lesson09/x.py | PacktPublishing/Python-Fundamentals | f24569826b1b7f97e3d54630a34ae61110ca12da | [
"MIT"
] | 1 | 2021-04-23T14:01:56.000Z | 2021-04-23T14:01:56.000Z | Lesson09/x.py | PacktPublishing/Python-Fundamentals | f24569826b1b7f97e3d54630a34ae61110ca12da | [
"MIT"
] | null | null | null | Lesson09/x.py | PacktPublishing/Python-Fundamentals | f24569826b1b7f97e3d54630a34ae61110ca12da | [
"MIT"
] | 4 | 2021-06-29T05:57:44.000Z | 2021-09-02T10:14:55.000Z | def remove_punctuation(st, case='l'):
""" takes in a string and returns a list of words with no punctuation"""
punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}“”‘’~'
all_words = st.split()
cap_words = []
for c in punctuation:
st = st.replace(c, '')
if case == 'u':
for word in all... | 28.222222 | 76 | 0.602362 | def remove_punctuation(st, case='l'):
punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}“”‘’~'
all_words = st.split()
cap_words = []
for c in punctuation:
st = st.replace(c, '')
if case == 'u':
for word in all_words:
if word.istitle():
cap_words.append(word)... | true | true |
f716fffcedc3cbaba6d963cd4a7e2061ef83cc34 | 4,109 | py | Python | mdeepctr/models/xdeepfm.py | TS-SE-GROUP/icme2019 | 7eefdb7de6a7ff3bec1721fafb822d80d80dbba3 | [
"MIT"
] | 78 | 2019-02-21T12:44:11.000Z | 2022-03-30T11:42:33.000Z | mdeepctr/models/xdeepfm.py | rightnowandholdon/icme2019 | fe9b31db7bf19b08d5e5d41a259f0a297eb21766 | [
"MIT"
] | 6 | 2019-04-11T13:14:46.000Z | 2021-05-19T14:36:07.000Z | mdeepctr/models/xdeepfm.py | rightnowandholdon/icme2019 | fe9b31db7bf19b08d5e5d41a259f0a297eb21766 | [
"MIT"
] | 22 | 2019-02-21T02:51:54.000Z | 2021-12-10T02:04:28.000Z | # -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Reference:
[1] Lian J, Zhou X, Zhang F, et al. xDeepFM: Combining Explicit and Implicit Feature Interactions for Recommender Systems[J]. arXiv preprint arXiv:1803.05170, 2018.(https://arxiv.org/pdf/1803.05170.pdf)
"""
import tensorflow as tf
fr... | 54.065789 | 325 | 0.690436 | import tensorflow as tf
from ..input_embedding import preprocess_input_embedding
from ..layers.core import PredictionLayer, MLP
from ..layers.interaction import CIN
from ..utils import check_feature_config_dict
from ..layers.utils import concat_fun
def xDeepFM(feature_dim_dict, embedding_size=8, hidden_size=(256, 256... | true | true |
f717001c298682adebd3ce0fdb017a670744af55 | 4,004 | py | Python | ansible/deploy.py | CloudReactor/aws-ecs-cloudreactor-deployer | 0abf182780dae41e646eef7ef23c029a9cbbba43 | [
"BSD-2-Clause"
] | null | null | null | ansible/deploy.py | CloudReactor/aws-ecs-cloudreactor-deployer | 0abf182780dae41e646eef7ef23c029a9cbbba43 | [
"BSD-2-Clause"
] | null | null | null | ansible/deploy.py | CloudReactor/aws-ecs-cloudreactor-deployer | 0abf182780dae41e646eef7ef23c029a9cbbba43 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/local/bin/python
import argparse
import logging
import os
import shlex
import subprocess
import sys
_DEFAULT_LOG_LEVEL = 'INFO'
if __name__ == '__main__':
parser = argparse.ArgumentParser(prog='deploy', allow_abbrev=False,
description="""
Deploys a project to AWS ECS and CloudReactor using An... | 34.817391 | 94 | 0.693556 |
import argparse
import logging
import os
import shlex
import subprocess
import sys
_DEFAULT_LOG_LEVEL = 'INFO'
if __name__ == '__main__':
parser = argparse.ArgumentParser(prog='deploy', allow_abbrev=False,
description="""
Deploys a project to AWS ECS and CloudReactor using Ansible.
""")
deploym... | true | true |
f71700a02e9af92b95c627de9e9deee219c9f35c | 2,411 | py | Python | Chapter04/flask_test.py | cloudnatif/Cloud-Natif | 13b318981d946f26b37db6073252dcb31d0760b1 | [
"MIT"
] | 94 | 2017-07-28T07:19:42.000Z | 2022-01-25T21:09:06.000Z | Chapter04/flask_test.py | cloudnatif/Cloud-Natif | 13b318981d946f26b37db6073252dcb31d0760b1 | [
"MIT"
] | null | null | null | Chapter04/flask_test.py | cloudnatif/Cloud-Natif | 13b318981d946f26b37db6073252dcb31d0760b1 | [
"MIT"
] | 78 | 2017-03-15T17:27:55.000Z | 2022-01-25T21:09:30.000Z | # Test cases for restful API
from app import app
import unittest
class FlaskappTests(unittest.TestCase):
def setUp(self):
# creates a test client
self.app = app.test_client()
# propagate the exceptions to the test client
self.app.testing = True
def test_users_status_code(self):
... | 43.053571 | 203 | 0.662796 | from app import app
import unittest
class FlaskappTests(unittest.TestCase):
def setUp(self):
self.app = app.test_client()
self.app.testing = True
def test_users_status_code(self):
result = self.app.get('/api/v1/users')
print (result)
... | true | true |
f71700e3179565aa0840be71453d64b75aaf1335 | 17,142 | py | Python | eventlet/queue.py | ljz888666555/eventlet | 203e629212be5cf6e53d577734421d494b255754 | [
"MIT"
] | 1 | 2016-09-20T21:00:28.000Z | 2016-09-20T21:00:28.000Z | eventlet/queue.py | ljz888666555/eventlet | 203e629212be5cf6e53d577734421d494b255754 | [
"MIT"
] | null | null | null | eventlet/queue.py | ljz888666555/eventlet | 203e629212be5cf6e53d577734421d494b255754 | [
"MIT"
] | null | null | null | # Copyright (c) 2009 Denis Bilenko, denis.bilenko at gmail com
# Copyright (c) 2010 Eventlet Contributors (see AUTHORS)
# and licensed under the MIT license:
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... | 37.184382 | 117 | 0.605064 |
from __future__ import print_function
import sys
import heapq
import collections
import traceback
from eventlet.event import Event
from eventlet.greenthread import getcurrent
from eventlet.hubs import get_hub
from eventlet.support import six
from eventlet.timeout import Timeout
__all__ = ['Queue', 'PriorityQueue',... | true | true |
f7170216f50bfa3fdd6fc09085ea89978ae0086b | 756 | py | Python | googlelyrics/__main__.py | lastsecondsave/googlelyrics | b022953b82d84fee4caa1e7ea1edbc0374b89a22 | [
"MIT"
] | null | null | null | googlelyrics/__main__.py | lastsecondsave/googlelyrics | b022953b82d84fee4caa1e7ea1edbc0374b89a22 | [
"MIT"
] | null | null | null | googlelyrics/__main__.py | lastsecondsave/googlelyrics | b022953b82d84fee4caa1e7ea1edbc0374b89a22 | [
"MIT"
] | null | null | null | import sys
from argparse import ArgumentParser
from . import search
def parse_args():
parser = ArgumentParser(prog="googlelyrics")
parser.add_argument(
"--no-header", action="store_true", help="don't print the info header"
)
parser.add_argument("query", type=str, nargs="+", help="search quer... | 19.894737 | 78 | 0.633598 | import sys
from argparse import ArgumentParser
from . import search
def parse_args():
parser = ArgumentParser(prog="googlelyrics")
parser.add_argument(
"--no-header", action="store_true", help="don't print the info header"
)
parser.add_argument("query", type=str, nargs="+", help="search quer... | true | true |
f717023372944f7baec384fa86924fa77eb99257 | 894 | py | Python | alembic/versions/d6fcd3132857_episode_source.py | DmitryBurnaev/podcast-service | 53349a3f9aed22a8024d0c83380f9a02464962a3 | [
"MIT"
] | 5 | 2021-07-01T16:31:29.000Z | 2022-01-29T14:32:13.000Z | alembic/versions/d6fcd3132857_episode_source.py | DmitryBurnaev/podcast-service | 53349a3f9aed22a8024d0c83380f9a02464962a3 | [
"MIT"
] | 45 | 2020-10-25T19:41:26.000Z | 2022-03-25T06:31:58.000Z | alembic/versions/d6fcd3132857_episode_source.py | DmitryBurnaev/podcast-service | 53349a3f9aed22a8024d0c83380f9a02464962a3 | [
"MIT"
] | 1 | 2022-01-27T11:30:07.000Z | 2022-01-27T11:30:07.000Z | """episode_source
Revision ID: d6fcd3132857
Revises: bca0b2a3b5f4
Create Date: 2021-10-17 18:51:29.927189
"""
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from sqlalchemy import String
from alembic import op
# revision identifiers, used by Alembic.
revision = "d6fcd3132857"
down_revision = "bca0b... | 26.294118 | 94 | 0.719239 | import sqlalchemy as sa
from sqlalchemy.sql import table, column
from sqlalchemy import String
from alembic import op
revision = "d6fcd3132857"
down_revision = "bca0b2a3b5f4"
branch_labels = None
depends_on = None
episodes = table("podcast_episodes", column("source_type", String))
def upgrade():
op.add_col... | true | true |
f7170340f1b333ec00377c1b81345ad679ae62c9 | 9,484 | py | Python | homeassistant/components/lcn/__init__.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 3 | 2020-01-21T18:09:09.000Z | 2022-01-17T08:06:03.000Z | homeassistant/components/lcn/__init__.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 39 | 2016-12-16T12:40:34.000Z | 2017-02-13T17:53:42.000Z | homeassistant/components/lcn/__init__.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 6 | 2020-04-10T06:21:11.000Z | 2021-07-01T08:53:38.000Z | """Support for LCN devices."""
import logging
import pypck
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.climate import DEFAULT_MAX_TEMP, DEFAULT_MIN_TEMP
from homeassistant.const import (
CONF_ADDRESS,
CONF_BINARY_SENSORS,
CONF_COVERS,
CON... | 29.453416 | 88 | 0.614614 | import logging
import pypck
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.climate import DEFAULT_MAX_TEMP, DEFAULT_MIN_TEMP
from homeassistant.const import (
CONF_ADDRESS,
CONF_BINARY_SENSORS,
CONF_COVERS,
CONF_HOST,
CONF_LIGHTS,
CO... | true | true |
f717047c1e24f5939fecd31454d00b32da770cfe | 815 | py | Python | profiles_project/urls.py | Andrei-Ionescu-001/profiles-rest-api1 | fc5ceb57e3ef0dd00ab9c73b1ab65e5cee8f6c43 | [
"MIT"
] | null | null | null | profiles_project/urls.py | Andrei-Ionescu-001/profiles-rest-api1 | fc5ceb57e3ef0dd00ab9c73b1ab65e5cee8f6c43 | [
"MIT"
] | null | null | null | profiles_project/urls.py | Andrei-Ionescu-001/profiles-rest-api1 | fc5ceb57e3ef0dd00ab9c73b1ab65e5cee8f6c43 | [
"MIT"
] | null | null | null | """profiles_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cl... | 35.434783 | 77 | 0.707975 | from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path("api/", include('profiles_api.urls')),
]
| true | true |
f7170601a4453e0e9695176e02bd85d687d2032e | 408 | py | Python | PYTHON/Desafios Python - Mundo 1/027.py | FR7/Meus-Projetos | 1c8e1a91eaf143cccdc10f0e7edd013d910de474 | [
"MIT"
] | null | null | null | PYTHON/Desafios Python - Mundo 1/027.py | FR7/Meus-Projetos | 1c8e1a91eaf143cccdc10f0e7edd013d910de474 | [
"MIT"
] | null | null | null | PYTHON/Desafios Python - Mundo 1/027.py | FR7/Meus-Projetos | 1c8e1a91eaf143cccdc10f0e7edd013d910de474 | [
"MIT"
] | null | null | null | # Faça um programa que leia o nome completo de uma pessoa, mostrando em seguida o primeiro e o último nome, separadamente.
#Ex. Ana Maria de Souza
# Primeiro = Ana
# Último = Souza
nome = str(input('Digite seu nome Completo: ')).strip().upper()
n = nome.split()
print('Seu nome completo é: {}'.format(nome))
print('Se... | 31.384615 | 122 | 0.686275 |
nome = str(input('Digite seu nome Completo: ')).strip().upper()
n = nome.split()
print('Seu nome completo é: {}'.format(nome))
print('Seu primeiro nome é: {}'.format(n[0]))
print('Seu último nome é: {}'.format(n[len(n)-1]))
| true | true |
f717065229b5aa3e8bbbf8152fb8d179944a277e | 395 | py | Python | apps/article/migrations/0002_auto_20190227_1556.py | sakisrealop/website | 43a12492a90f1f03ec69a60b74f73a5fa7f4af75 | [
"MIT"
] | 312 | 2019-02-22T02:12:39.000Z | 2022-03-28T03:51:44.000Z | apps/article/migrations/0002_auto_20190227_1556.py | Atheny/website | 28cf598488465695e4d1e2691e8d162b9c253e27 | [
"MIT"
] | 21 | 2019-04-01T04:38:50.000Z | 2022-03-11T23:43:55.000Z | apps/article/migrations/0002_auto_20190227_1556.py | Atheny/website | 28cf598488465695e4d1e2691e8d162b9c253e27 | [
"MIT"
] | 97 | 2019-01-29T02:23:09.000Z | 2022-02-26T17:25:41.000Z | # Generated by Django 2.0.8 on 2019-02-27 15:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('article', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='category_article',
name='add_time',
... | 20.789474 | 58 | 0.607595 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('article', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='category_article',
name='add_time',
field=models.DateTimeField(auto_now_a... | true | true |
f7170654671a68ef6a00e9dc095703a97a4c6389 | 13,779 | py | Python | run_alicevision.py | sinithwar/Ruby_Run_Alice_Vision | 5ad3e6b02b1bca962cdcdbda1a6d7f1b31474667 | [
"CC0-1.0"
] | null | null | null | run_alicevision.py | sinithwar/Ruby_Run_Alice_Vision | 5ad3e6b02b1bca962cdcdbda1a6d7f1b31474667 | [
"CC0-1.0"
] | null | null | null | run_alicevision.py | sinithwar/Ruby_Run_Alice_Vision | 5ad3e6b02b1bca962cdcdbda1a6d7f1b31474667 | [
"CC0-1.0"
] | null | null | null | import sys, os
import shutil
def SilentMkdir(theDir):
try:
os.mkdir(theDir)
except:
pass
return 0
def Run_00_CameraInit(baseDir,binDir,srcImageDir):
SilentMkdir(baseDir + "/00_CameraInit")
binName = binDir + "\\aliceVision_cameraInit.exe"
dstDir = baseDir + "/00_CameraInit/"
cmdLine = binName
cmdLine =... | 36.165354 | 595 | 0.725016 | import sys, os
import shutil
def SilentMkdir(theDir):
try:
os.mkdir(theDir)
except:
pass
return 0
def Run_00_CameraInit(baseDir,binDir,srcImageDir):
SilentMkdir(baseDir + "/00_CameraInit")
binName = binDir + "\\aliceVision_cameraInit.exe"
dstDir = baseDir + "/00_CameraInit/"
cmdLine = binName
cmdLine =... | true | true |
f71707097c636c343b5861abc9032e2e393f7ac3 | 2,560 | py | Python | lib/bullet/src/examples/pybullet/inverse_kinematics.py | mtesseracttech/CustomEngine | 1a9ed564408ae29fe49681a810b851403d71f486 | [
"Apache-2.0"
] | 5 | 2016-07-04T15:00:01.000Z | 2021-01-19T02:42:48.000Z | lib/bullet/src/examples/pybullet/inverse_kinematics.py | mtesseracttech/CustomEngine | 1a9ed564408ae29fe49681a810b851403d71f486 | [
"Apache-2.0"
] | null | null | null | lib/bullet/src/examples/pybullet/inverse_kinematics.py | mtesseracttech/CustomEngine | 1a9ed564408ae29fe49681a810b851403d71f486 | [
"Apache-2.0"
] | 1 | 2016-04-23T07:47:32.000Z | 2016-04-23T07:47:32.000Z | import pybullet as p
import time
import math
from datetime import datetime
#clid = p.connect(p.SHARED_MEMORY)
p.connect(p.GUI)
p.loadURDF("plane.urdf",[0,0,-0.3])
kukaId = p.loadURDF("kuka_iiwa/model.urdf",[0,0,0])
p.resetBasePositionAndOrientation(kukaId,[0,0,0],[0,0,0,1])
kukaEndEffectorIndex = 6
numJoints = p.getNu... | 29.767442 | 178 | 0.732813 | import pybullet as p
import time
import math
from datetime import datetime
p.connect(p.GUI)
p.loadURDF("plane.urdf",[0,0,-0.3])
kukaId = p.loadURDF("kuka_iiwa/model.urdf",[0,0,0])
p.resetBasePositionAndOrientation(kukaId,[0,0,0],[0,0,0,1])
kukaEndEffectorIndex = 6
numJoints = p.getNumJoints(kukaId)
if (numJoints!=7):
... | true | true |
f717072f58bacbac6ee72e5f50a62ccb40155d02 | 688 | py | Python | bdlb/diabetic_retinopathy_diagnosis/__init__.py | jrubin01/bdl-benchmarks | 1a6118750006febcd73a68af488a61673b6924b1 | [
"Apache-2.0"
] | 1 | 2020-10-30T09:13:49.000Z | 2020-10-30T09:13:49.000Z | bdlb/diabetic_retinopathy_diagnosis/__init__.py | jrubin01/bdl-benchmarks | 1a6118750006febcd73a68af488a61673b6924b1 | [
"Apache-2.0"
] | 5 | 2019-10-26T19:05:04.000Z | 2022-03-30T08:07:46.000Z | bdlb/diabetic_retinopathy_diagnosis/__init__.py | jrubin01/bdl-benchmarks | 1a6118750006febcd73a68af488a61673b6924b1 | [
"Apache-2.0"
] | 2 | 2020-09-12T13:06:14.000Z | 2020-12-01T13:22:45.000Z | # Copyright 2019 BDL Benchmarks 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... | 49.142857 | 80 | 0.677326 | true | true | |
f7170733d9d5dfa19bfa97dde2fa1c168c81130c | 9,133 | py | Python | pysnmp-with-texts/V-BRIDGE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/V-BRIDGE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/V-BRIDGE-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module V-BRIDGE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/V-BRIDGE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:33:25 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019,... | 118.61039 | 849 | 0.783861 | Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint, SingleValueConstraint, ConstraintsUnion = mibBuilder.impo... | true | true |
f71708f6e5870838a55c5650db911c0b554c69fb | 10,593 | py | Python | oneflow/python/test/models/vgg16.py | xxg1413/oneflow | f2e3c85a25b8aecfb6c0c0af1737833b1a77e135 | [
"Apache-2.0"
] | 1 | 2020-12-04T03:06:16.000Z | 2020-12-04T03:06:16.000Z | oneflow/python/test/models/vgg16.py | xxg1413/oneflow | f2e3c85a25b8aecfb6c0c0af1737833b1a77e135 | [
"Apache-2.0"
] | null | null | null | oneflow/python/test/models/vgg16.py | xxg1413/oneflow | f2e3c85a25b8aecfb6c0c0af1737833b1a77e135 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 31.906627 | 85 | 0.657604 | import argparse
import os
from datetime import datetime
import numpy
import oneflow as flow
import oneflow.core.operator.op_conf_pb2 as op_conf_util
_DATA_DIR = "/dataset/PNGS/PNG224/of_record_repeated"
_SINGLE_DATA_DIR = "/dataset/PNGS/PNG224/of_record"
_MODEL_LOAD_DIR = "/dataset/PNGS/cnns_model_for_test/vgg16/mode... | true | true |
f71709855ef2b9332e7d2df3b90c353b07b8c069 | 4,134 | py | Python | workflow/scripts/FilterUncorrectabledPEfastq.py | osvaldoreisss/transcriptome_assembly_workflow | bef17c05cb0287e2b46f6018cac757be58b508c5 | [
"MIT"
] | null | null | null | workflow/scripts/FilterUncorrectabledPEfastq.py | osvaldoreisss/transcriptome_assembly_workflow | bef17c05cb0287e2b46f6018cac757be58b508c5 | [
"MIT"
] | null | null | null | workflow/scripts/FilterUncorrectabledPEfastq.py | osvaldoreisss/transcriptome_assembly_workflow | bef17c05cb0287e2b46f6018cac757be58b508c5 | [
"MIT"
] | null | null | null | """
author: adam h freedman
afreedman405 at gmail.com
data: Fri Aug 26 10:55:18 EDT 2016
This script takes as an input Rcorrector error corrected Illumina paired-reads
in fastq format and:
1. Removes any reads that Rcorrector indentifes as containing an error,
but can't be corrected, typically low complexity sequence... | 38.277778 | 329 | 0.648766 | """
author: adam h freedman
afreedman405 at gmail.com
data: Fri Aug 26 10:55:18 EDT 2016
This script takes as an input Rcorrector error corrected Illumina paired-reads
in fastq format and:
1. Removes any reads that Rcorrector indentifes as containing an error,
but can't be corrected, typically low complexity sequence... | false | true |
f71709ad2911d4c2d64410be79854cf9a92e3003 | 13,191 | py | Python | pommerman/envs/v0.py | xysun/playground | 20f9a7e0eb3d24e7cd32d8afd94b767b8fcc00b4 | [
"Apache-2.0"
] | null | null | null | pommerman/envs/v0.py | xysun/playground | 20f9a7e0eb3d24e7cd32d8afd94b767b8fcc00b4 | [
"Apache-2.0"
] | null | null | null | pommerman/envs/v0.py | xysun/playground | 20f9a7e0eb3d24e7cd32d8afd94b767b8fcc00b4 | [
"Apache-2.0"
] | null | null | null | """The baseline Pommerman environment.
This evironment acts as game manager for Pommerman. Further environments,
such as in v1.py, will inherit from this.
"""
import json
import os
import numpy as np
import time
from gym import spaces
from gym.utils import seeding
import gym
from .. import characters
from .. import ... | 37.157746 | 80 | 0.578197 | import json
import os
import numpy as np
import time
from gym import spaces
from gym.utils import seeding
import gym
from .. import characters
from .. import constants
from .. import forward_model
from .. import graphics
from .. import utility
class Pomme(gym.Env):
metadata = {
'render.modes': ['human',... | true | true |
f7170a4a00a9b5ea431fcc159ff237369b376a27 | 5,708 | py | Python | syft/frameworks/torch/fl/utils.py | shubhamsingh987/PySyft | ff967e3735bd7d47667d1d3e5038ba1493ca2e90 | [
"Apache-2.0"
] | 1 | 2020-05-25T13:44:29.000Z | 2020-05-25T13:44:29.000Z | syft/frameworks/torch/fl/utils.py | shubhamsingh987/PySyft | ff967e3735bd7d47667d1d3e5038ba1493ca2e90 | [
"Apache-2.0"
] | 2 | 2020-03-09T09:17:06.000Z | 2020-04-09T13:33:12.000Z | syft/frameworks/torch/fl/utils.py | shubhamsingh987/PySyft | ff967e3735bd7d47667d1d3e5038ba1493ca2e90 | [
"Apache-2.0"
] | 1 | 2022-03-06T06:22:21.000Z | 2022-03-06T06:22:21.000Z | import syft as sy
import torch
from typing import Dict
from typing import Any
import logging
logger = logging.getLogger(__name__)
def extract_batches_per_worker(federated_train_loader: sy.FederatedDataLoader):
"""Extracts the batches from the federated_train_loader and stores them
in a dictionary (keys = ... | 29.884817 | 103 | 0.596181 | import syft as sy
import torch
from typing import Dict
from typing import Any
import logging
logger = logging.getLogger(__name__)
def extract_batches_per_worker(federated_train_loader: sy.FederatedDataLoader):
logging_interval = 100
batches = {}
for worker_id in federated_train_loader.workers:
wo... | true | true |
f7170ac6132a5c5e78915df4b9f637eb7aa8674a | 6,819 | py | Python | pool/models.py | tammer/pool | bacf2da7106ba9eaff7d4bde3b6e04823cd6a515 | [
"MIT"
] | null | null | null | pool/models.py | tammer/pool | bacf2da7106ba9eaff7d4bde3b6e04823cd6a515 | [
"MIT"
] | null | null | null | pool/models.py | tammer/pool | bacf2da7106ba9eaff7d4bde3b6e04823cd6a515 | [
"MIT"
] | null | null | null | # -*- coding: future_fstrings -*-
from django.db import models
from django.contrib.auth.models import User
import datetime
from pytz import timezone
def now():
# return Main.objects.all().first().now
return datetime.datetime.now()
def set_now(d):
m = Main.objects.all().first()
m.now = d
m.save()
class Team(mode... | 29.519481 | 195 | 0.723713 | from django.db import models
from django.contrib.auth.models import User
import datetime
from pytz import timezone
def now():
return datetime.datetime.now()
def set_now(d):
m = Main.objects.all().first()
m.now = d
m.save()
class Team(models.Model):
full_name = models.CharField(max_length=50)
short_name = mode... | true | true |
f7170ac8f8e6a649b111e7906e5760a225c20807 | 619 | py | Python | flexible_reports/migrations/0009_auto_20171025_0558.py | mpasternak/django-flexible-reports | cdf62590efb2937b30e19952a67afbc3a3e1c192 | [
"MIT"
] | 2 | 2017-08-31T11:55:26.000Z | 2018-07-14T19:39:05.000Z | flexible_reports/migrations/0009_auto_20171025_0558.py | mpasternak/django-flexible-reports | cdf62590efb2937b30e19952a67afbc3a3e1c192 | [
"MIT"
] | 1 | 2017-08-24T07:04:46.000Z | 2017-09-23T14:39:06.000Z | flexible_reports/migrations/0009_auto_20171025_0558.py | mpasternak/django-flexible-reports | cdf62590efb2937b30e19952a67afbc3a3e1c192 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-10-25 10:58
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('flexible_reports', '0008_auto_20171025_0553'),
]
o... | 28.136364 | 165 | 0.678514 | from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('flexible_reports', '0008_auto_20171025_0553'),
]
operations = [
migrations.AlterField(
model_name='repo... | true | true |
f7170bc3e6ea26e09566be6cd362d8f830bcb772 | 4,016 | py | Python | InvenTree/InvenTree/urls.py | mtrazakhan/invent | dfcb8209855f566b8bd5a23e8bd3d5d1b726beaf | [
"MIT"
] | null | null | null | InvenTree/InvenTree/urls.py | mtrazakhan/invent | dfcb8209855f566b8bd5a23e8bd3d5d1b726beaf | [
"MIT"
] | 8 | 2020-06-06T01:14:46.000Z | 2022-03-12T00:14:35.000Z | InvenTree/InvenTree/urls.py | mtrazakhan/invent | dfcb8209855f566b8bd5a23e8bd3d5d1b726beaf | [
"MIT"
] | null | null | null | """
Top-level URL lookup for InvenTree application.
Passes URL lookup downstream to each app as required.
"""
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth import views as auth_views
from qr_code import urls as qr_code_urls
from company.urls import company_urls
... | 34.033898 | 122 | 0.728088 |
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth import views as auth_views
from qr_code import urls as qr_code_urls
from company.urls import company_urls
from company.urls import supplier_part_urls
from company.urls import price_break_urls
from common.urls import ... | true | true |
f7170c3b4209a882e4b52313adf31afa74155a64 | 2,107 | py | Python | main.py | flace/text-generator | 4392a4071a0d203b0b5f814c77fb7b0943acad79 | [
"MIT"
] | null | null | null | main.py | flace/text-generator | 4392a4071a0d203b0b5f814c77fb7b0943acad79 | [
"MIT"
] | null | null | null | main.py | flace/text-generator | 4392a4071a0d203b0b5f814c77fb7b0943acad79 | [
"MIT"
] | null | null | null | import sys
import os
import json
import time
from nlp_tools import tokenize_words, build_prob_language_model, generate_text_using_trigrams
from files_io import load_text, serialize, deserialize
if __name__ == '__main__':
args = sys.argv[1:]
N_WORDS = args[0]
FILES_FOLDER = 'files'
TMP_FOLDER = os.path... | 36.964912 | 98 | 0.6972 | import sys
import os
import json
import time
from nlp_tools import tokenize_words, build_prob_language_model, generate_text_using_trigrams
from files_io import load_text, serialize, deserialize
if __name__ == '__main__':
args = sys.argv[1:]
N_WORDS = args[0]
FILES_FOLDER = 'files'
TMP_FOLDER = os.path... | true | true |
f7170d095793806b6b0978bf391117e084b45d00 | 789 | py | Python | freezer_api/__init__.py | ctpegasus/freezer-api | b784327252ac6132a4d3b87c50e9a99c70d6c938 | [
"Apache-2.0"
] | 22 | 2015-10-18T02:53:47.000Z | 2021-09-19T10:38:12.000Z | freezer_api/__init__.py | ctpegasus/freezer-api | b784327252ac6132a4d3b87c50e9a99c70d6c938 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | freezer_api/__init__.py | ctpegasus/freezer-api | b784327252ac6132a4d3b87c50e9a99c70d6c938 | [
"Apache-2.0"
] | 20 | 2016-03-08T08:34:56.000Z | 2020-10-13T06:50:05.000Z | # (c) Copyright 2016 Hewlett-Packard Enterprise Development Company, L.P.
#
# 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 require... | 35.863636 | 74 | 0.768061 |
import pbr.version
__version__ = pbr.version.VersionInfo('freezer-api').version_string()
version_info = pbr.version.VersionInfo('freezer-api')
| true | true |
f7170dafbded2faa0073fa4e84b225d8c30b922d | 9,839 | py | Python | ising_low.py | kartik-gatsby/optimized-ising-model | 1a9b0210deb26d73f93aec5b0804baaebf9c6ff9 | [
"MIT"
] | 1 | 2020-06-07T00:11:17.000Z | 2020-06-07T00:11:17.000Z | ising_low.py | kartik-gatsby/optimized-ising-model | 1a9b0210deb26d73f93aec5b0804baaebf9c6ff9 | [
"MIT"
] | null | null | null | ising_low.py | kartik-gatsby/optimized-ising-model | 1a9b0210deb26d73f93aec5b0804baaebf9c6ff9 | [
"MIT"
] | null | null | null | import numpy as np
from random import random
import matplotlib.pyplot as plt
import time
import logging
logging.basicConfig(level=logging.INFO,filename='simulation.log', filemode='w',format='%(asctime)s - %(message)s',datefmt='%d-%b-%y %H:%M:%S')
np.seterr(all='warn')
#################################################... | 38.73622 | 281 | 0.57018 | import numpy as np
from random import random
import matplotlib.pyplot as plt
import time
import logging
logging.basicConfig(level=logging.INFO,filename='simulation.log', filemode='w',format='%(asctime)s - %(message)s',datefmt='%d-%b-%y %H:%M:%S')
np.seterr(all='warn')
logging.info("Starting Ising Model Simulation")
T... | true | true |
f7170de985b4d2849b9f1917151cdfb0f523b4b6 | 247 | py | Python | test.py | namitkewat/cy_aho_corasick | e9483f7efe60d3a1f9904d059dedbd021858f31c | [
"MIT"
] | 2 | 2021-08-10T03:14:43.000Z | 2021-08-10T03:17:39.000Z | test.py | namitkewat/cy_aho_corasick | e9483f7efe60d3a1f9904d059dedbd021858f31c | [
"MIT"
] | null | null | null | test.py | namitkewat/cy_aho_corasick | e9483f7efe60d3a1f9904d059dedbd021858f31c | [
"MIT"
] | 2 | 2019-04-26T09:47:35.000Z | 2021-08-10T03:18:03.000Z | import cy_aho_corasick as cy_aho
# print(dir(cyAhoCorasick))
t = cy_aho.Trie(remove_overlaps=True)
t.insert(b"sugar")
print(t.parse_text(b"sugarcane sugarcane sugar canesugar"))
print(t.parse_text_values(b"sugarcane sugarcane sugar canesugar"))
| 27.444444 | 66 | 0.801619 | import cy_aho_corasick as cy_aho
t = cy_aho.Trie(remove_overlaps=True)
t.insert(b"sugar")
print(t.parse_text(b"sugarcane sugarcane sugar canesugar"))
print(t.parse_text_values(b"sugarcane sugarcane sugar canesugar"))
| true | true |
f7170eb00fc11965e5ade80c62bfb984df7625cd | 14,665 | py | Python | fairseq/fairseq_cli/preprocess.py | shalei120/AutoInsert | 89ec5dadd252d79586fe3e44f1d315c5ec938c1f | [
"MIT"
] | 28 | 2021-09-15T01:25:00.000Z | 2022-03-01T20:21:28.000Z | fairseq/fairseq_cli/preprocess.py | shalei120/AutoInsert | 89ec5dadd252d79586fe3e44f1d315c5ec938c1f | [
"MIT"
] | 2 | 2022-03-25T07:55:12.000Z | 2022-03-28T12:46:05.000Z | fairseq/fairseq_cli/preprocess.py | shalei120/AutoInsert | 89ec5dadd252d79586fe3e44f1d315c5ec938c1f | [
"MIT"
] | 2 | 2021-09-14T07:20:11.000Z | 2021-09-23T08:00:24.000Z | #!/usr/bin/env python3
# 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.
"""
Data pre-processing: build vocabularies and binarize training data.
"""
import logging
import os
import shutil
impo... | 35.943627 | 88 | 0.561132 |
import logging
import os
import shutil
import sys
from collections import Counter
from itertools import zip_longest
from multiprocessing import Pool
from fairseq import options, tasks, utils
from fairseq.binarizer import Binarizer
from fairseq.data import indexed_dataset
from fairseq.file_chunker_utils import find_of... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.