hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7fdd9a08c27c767cdf64427dfbfed5aeb57825d | 1,992 | py | Python | ooobuild/lo/animations/x_animate_color.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/animations/x_animate_color.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/animations/x_animate_color.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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... | 34.947368 | 135 | 0.725402 |
from abc import abstractproperty
from .x_animate import XAnimate as XAnimate_ca680c52
class XAnimateColor(XAnimate_ca680c52):
__ooo_ns__: str = 'com.sun.star.animations'
__ooo_full_ns__: str = 'com.sun.star.animations.XAnimateColor'
__ooo_type_name__: str = 'interface'
__pyunointerf... | true | true |
f7fdda0ce6d96a5cb012c54ea8d48ad17684fa3b | 3,356 | py | Python | src/assignments/assignment3.py | acc-cosc-1336/cosc-1336-spring-2018-EricScotty | 80c0249a583dc178cfc7bb95b851d7f3240dc3e9 | [
"MIT"
] | null | null | null | src/assignments/assignment3.py | acc-cosc-1336/cosc-1336-spring-2018-EricScotty | 80c0249a583dc178cfc7bb95b851d7f3240dc3e9 | [
"MIT"
] | null | null | null | src/assignments/assignment3.py | acc-cosc-1336/cosc-1336-spring-2018-EricScotty | 80c0249a583dc178cfc7bb95b851d7f3240dc3e9 | [
"MIT"
] | null | null | null |
def decimal_to_binary(number):
'''
YOU MUST USE A WHILE LOOP
Given a number return its binary value in 8 bits
:param number: A whole number from 0-255
:return: a byte (8 bits) binary
TO GET CREDIT, YOU MUST WRITE CODE FOR FOLLOWING PSEUDOCODE Algorithm
Create a binary variable set... | 31.074074 | 112 | 0.625447 |
def decimal_to_binary(number):
binary = ''
for int in range (7,-1,-1):
value = 2 ** int
if value <= number:
binary += '1'
number = number - value
else:
binary+='0'
return binary
def sum_square_of_number(number):
sum_o... | true | true |
f7fddc74e3bd0da3b983ba2082a158b251918951 | 485 | py | Python | src/Classes/MSDS400/Module 8/orchids.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | src/Classes/MSDS400/Module 8/orchids.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | src/Classes/MSDS400/Module 8/orchids.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | # 7 orchids from a collection of 20 are to be selected for a flower show. Complete parts (a) and (b) below.
import math
from functools import reduce
from operator import mul # or mul=lambda x,y:x*y
from fractions import Fraction
def nCk(n,k):
return int( reduce(mul, ( Fraction( n - i, i+ 1) for i in range( k... | 32.333333 | 110 | 0.686598 |
import math
from functools import reduce
from operator import mul
from fractions import Fraction
def nCk(n,k):
return int( reduce(mul, ( Fraction( n - i, i+ 1) for i in range( k ) ), 1) )
nCk( 20, 7 )
nCk( 18, 5 ) | true | true |
f7fddc833d74a103b60b8dc2feb0f9793a54c4c5 | 12,036 | py | Python | tests/test_crystal.py | dquigley-warwick/matador | 729e97efb0865c4fff50af87555730ff4b7b6d91 | [
"MIT"
] | null | null | null | tests/test_crystal.py | dquigley-warwick/matador | 729e97efb0865c4fff50af87555730ff4b7b6d91 | [
"MIT"
] | null | null | null | tests/test_crystal.py | dquigley-warwick/matador | 729e97efb0865c4fff50af87555730ff4b7b6d91 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# standard library
import unittest
import copy
from os.path import realpath
import numpy as np
# matador modules
from matador.crystal.crystal import Crystal, UnitCell
from matador.crystal.crystal_site import Site
from matador.scrapers.castep_scrapers import castep2dict, res2dict
from matador.uti... | 41.219178 | 98 | 0.622383 |
import unittest
import copy
from os.path import realpath
import numpy as np
from matador.crystal.crystal import Crystal, UnitCell
from matador.crystal.crystal_site import Site
from matador.scrapers.castep_scrapers import castep2dict, res2dict
from matador.utils.cell_utils import frac2cart
from matador.scrapers.mag... | true | true |
f7fddd06e2471b72240c6432c772b4245f286880 | 4,658 | py | Python | test.py | chrisqqq123/FA-Dist-EfficientNet | cb788b0f212d568d9bf04a51516d79fed5383585 | [
"MIT"
] | 1 | 2022-03-09T02:24:22.000Z | 2022-03-09T02:24:22.000Z | test.py | chrisqqq123/FA-Dist-EfficientNet | cb788b0f212d568d9bf04a51516d79fed5383585 | [
"MIT"
] | null | null | null | test.py | chrisqqq123/FA-Dist-EfficientNet | cb788b0f212d568d9bf04a51516d79fed5383585 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Script to test a pytorch model on Cifar100's validation set."""
import argparse
import logging
import pprint
import sys
import time
import torch
from torch import nn
from models import model_factory
import opts
import utils
import mul_cifar100
def parse_args(argv):
"""Parse arguments ... | 35.287879 | 107 | 0.640833 |
import argparse
import logging
import pprint
import sys
import time
import torch
from torch import nn
from models import model_factory
import opts
import utils
import mul_cifar100
def parse_args(argv):
parser = argparse.ArgumentParser(description=__doc__, allow_abbrev=False)
group = parser.add_argument_g... | true | true |
f7fddd243e7d093627acd79beeb9c70e14af278a | 1,572 | py | Python | VideoUtils/codec.py | epmcj/nextflix | de15f0a63fe8906a0417da675b9a1c408f71bc79 | [
"MIT"
] | null | null | null | VideoUtils/codec.py | epmcj/nextflix | de15f0a63fe8906a0417da675b9a1c408f71bc79 | [
"MIT"
] | null | null | null | VideoUtils/codec.py | epmcj/nextflix | de15f0a63fe8906a0417da675b9a1c408f71bc79 | [
"MIT"
] | null | null | null | import numpy as np
import structures as st
#return a data object containing an entire frame
def decomposeFrame(frame,frameNum):
channelList = []
if len(frame.shape)==3:
for i in range(frame.shape[2]):
channelList.append(decomposeMatrix(frame[:,:,i]))
else:
channelList.append(decomposeMatrix(frame))
return(s... | 26.644068 | 73 | 0.701654 | import numpy as np
import structures as st
def decomposeFrame(frame,frameNum):
channelList = []
if len(frame.shape)==3:
for i in range(frame.shape[2]):
channelList.append(decomposeMatrix(frame[:,:,i]))
else:
channelList.append(decomposeMatrix(frame))
return(st.Data(channelList, frameNum))
def decomposeMa... | true | true |
f7fddd71a9030bafa5e3d9c34da976d9c9f787b7 | 5,649 | py | Python | python/lbann/contrib/modules/radial_profile.py | LLNL/LBANN | 8bcc5d461e52de70e329d73081ca7eee3e5c580a | [
"Apache-2.0"
] | null | null | null | python/lbann/contrib/modules/radial_profile.py | LLNL/LBANN | 8bcc5d461e52de70e329d73081ca7eee3e5c580a | [
"Apache-2.0"
] | null | null | null | python/lbann/contrib/modules/radial_profile.py | LLNL/LBANN | 8bcc5d461e52de70e329d73081ca7eee3e5c580a | [
"Apache-2.0"
] | null | null | null | import numpy as np
import lbann
import lbann.modules
class RadialProfile(lbann.modules.Module):
"""Compute average pixel value w.r.t. distance from image center.
We compute the distance between each image pixel and the image
center. These distances are binned (with a bin size of 1), and the
average pi... | 32.096591 | 78 | 0.601699 | import numpy as np
import lbann
import lbann.modules
class RadialProfile(lbann.modules.Module):
def __init__(self):
pass
def forward(self, image, dims, max_r):
r, r_counts = self._find_radial_bins(dims[1:], max_r)
r_counts_recip = [0 if c==0 else 1/c for c... | true | true |
f7fddd8de9efccb054a1b2894bf3c394477db6d0 | 3,709 | py | Python | baselines/a2c/utils.py | MoritzTaylor/baselines-tf2 | f51e40707b3c3021ae6309788d0cc0f29832dbea | [
"MIT"
] | 1 | 2020-02-28T06:41:52.000Z | 2020-02-28T06:41:52.000Z | baselines/a2c/utils.py | MoritzTaylor/baselines-tf2 | f51e40707b3c3021ae6309788d0cc0f29832dbea | [
"MIT"
] | null | null | null | baselines/a2c/utils.py | MoritzTaylor/baselines-tf2 | f51e40707b3c3021ae6309788d0cc0f29832dbea | [
"MIT"
] | null | null | null | import os
import numpy as np
import tensorflow as tf
from collections import deque
def ortho_init(scale=1.0):
def _ortho_init(shape, dtype, partition_info=None):
#lasagne ortho init for tf
shape = tuple(shape)
if len(shape) == 2:
flat_shape = shape
elif len(shape) == 4: ... | 41.674157 | 114 | 0.649771 | import os
import numpy as np
import tensorflow as tf
from collections import deque
def ortho_init(scale=1.0):
def _ortho_init(shape, dtype, partition_info=None):
shape = tuple(shape)
if len(shape) == 2:
flat_shape = shape
elif len(shape) == 4:
flat_shape = ... | true | true |
f7fde31fd4590e09f06e1fb72c2e458099119596 | 7,192 | py | Python | datahub/company/test/admin/test_update_from_dnb.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | null | null | null | datahub/company/test/admin/test_update_from_dnb.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | 4 | 2021-06-30T10:34:50.000Z | 2021-06-30T10:34:51.000Z | datahub/company/test/admin/test_update_from_dnb.py | Staberinde/data-hub-api | 3d0467dbceaf62a47158eea412a3dba827073300 | [
"MIT"
] | null | null | null | from urllib.parse import urljoin
import pytest
from django.conf import settings
from django.contrib.admin.templatetags.admin_urls import admin_urlname
from django.contrib.messages import get_messages
from django.urls import reverse
from rest_framework import status
from reversion.models import Version
from datahub.co... | 35.60396 | 95 | 0.635984 | from urllib.parse import urljoin
import pytest
from django.conf import settings
from django.contrib.admin.templatetags.admin_urls import admin_urlname
from django.contrib.messages import get_messages
from django.urls import reverse
from rest_framework import status
from reversion.models import Version
from datahub.co... | true | true |
f7fde3d9cf40f13051a639dd72146d2dd64eb354 | 220 | py | Python | setup.py | CamCairns/house_price_model | c7abb3449fef67cfe673bccb2abc627b1cab9dcb | [
"MIT"
] | null | null | null | setup.py | CamCairns/house_price_model | c7abb3449fef67cfe673bccb2abc627b1cab9dcb | [
"MIT"
] | 1 | 2019-08-23T23:59:05.000Z | 2019-08-23T23:59:05.000Z | setup.py | CamCairns/house_price_model | c7abb3449fef67cfe673bccb2abc627b1cab9dcb | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='A short description of the project.',
author='Cam Cairns',
license='MIT',
)
| 20 | 54 | 0.663636 | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.1.0',
description='A short description of the project.',
author='Cam Cairns',
license='MIT',
)
| true | true |
f7fde3f6d022b1b6ff5dc2244c2d042249f10b02 | 45,995 | py | Python | cms/tests/test_placeholder.py | evildmp/django-cms | 15f47a7acb22a112c343dca72597f4b8e6c0d593 | [
"BSD-3-Clause"
] | 1 | 2020-04-09T19:53:43.000Z | 2020-04-09T19:53:43.000Z | cms/tests/test_placeholder.py | maykinmedia/django-cms-sea | 16974c6ebf8fcb190ee42f1267a7ec4ee14a1b4c | [
"BSD-3-Clause"
] | 1 | 2017-01-04T16:58:49.000Z | 2017-01-04T16:58:49.000Z | cms/tests/test_placeholder.py | evildmp/django-cms | 15f47a7acb22a112c343dca72597f4b8e6c0d593 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.cache import cache
from django.core.exceptions import ImproperlyConfigured
from django.template import TemplateSyntaxError, Template
from django.template.loader import get_template
from django.test i... | 43.555871 | 186 | 0.631112 |
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.cache import cache
from django.core.exceptions import ImproperlyConfigured
from django.template import TemplateSyntaxError, Template
from django.template.loader import get_template
from django.test import TestCase
from dja... | true | true |
f7fde447fc00d01bd9a584e0c6c4928f1c5b2a6c | 320 | py | Python | pritunl_wireguard_client/utils/__init__.py | SuperBo/pritunl-wireguard-cient | bed4407bf2b7811f7180d72446a2dc26d45db90d | [
"MIT"
] | 1 | 2021-02-16T07:08:46.000Z | 2021-02-16T07:08:46.000Z | pritunl_wireguard_client/utils/__init__.py | SuperBo/pritunl-wireguard-cient | bed4407bf2b7811f7180d72446a2dc26d45db90d | [
"MIT"
] | 1 | 2022-02-08T13:34:18.000Z | 2022-02-08T13:34:18.000Z | pritunl_wireguard_client/utils/__init__.py | SuperBo/pritunl-wireguard-cient | bed4407bf2b7811f7180d72446a2dc26d45db90d | [
"MIT"
] | 1 | 2021-03-18T14:34:41.000Z | 2021-03-18T14:34:41.000Z | from pritunl_wireguard_client.utils.importer import download_profile
from pritunl_wireguard_client.utils.pritunl_auth import \
pritunl_auth, pritunl_sign, verify_signature, ClientBox
from pritunl_wireguard_client.utils.token import Tokens
from pritunl_wireguard_client.utils.random import rand_str, rand_str_complex
| 53.333333 | 76 | 0.88125 | from pritunl_wireguard_client.utils.importer import download_profile
from pritunl_wireguard_client.utils.pritunl_auth import \
pritunl_auth, pritunl_sign, verify_signature, ClientBox
from pritunl_wireguard_client.utils.token import Tokens
from pritunl_wireguard_client.utils.random import rand_str, rand_str_complex
| true | true |
f7fde454834319d4d9c8d2871748e00cbe81e975 | 3,325 | py | Python | nicos_jcns/dls01/setups/dls.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_jcns/dls01/setups/dls.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-08-18T10:55:42.000Z | 2021-08-18T10:55:42.000Z | nicos_jcns/dls01/setups/dls.py | ISISComputingGroup/nicos | 94cb4d172815919481f8c6ee686f21ebb76f2068 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
description = 'Dynamic light scattering setup'
group = 'basic'
includes = []
sysconfig = dict(
datasinks = ['dlssink'],
)
tango_base = 'tango://localhost:10000/dls/'
devices = dict(
card1 = device('nicos_mlz.kws1.devices.dls.DLSCard',
description = 'DLS correlator card 1',
... | 33.928571 | 83 | 0.609624 |
description = 'Dynamic light scattering setup'
group = 'basic'
includes = []
sysconfig = dict(
datasinks = ['dlssink'],
)
tango_base = 'tango://localhost:10000/dls/'
devices = dict(
card1 = device('nicos_mlz.kws1.devices.dls.DLSCard',
description = 'DLS correlator card 1',
tangodevice = ta... | true | true |
f7fde46912c623b128f20f9d652dc37ac047f57b | 4,660 | py | Python | utils/pysot/datasets/vot.py | ywang-37/EnhancedSiamShipTracking | 0b25cf02b6088268a6c374cb20a7f0355bc65b2e | [
"Apache-2.0"
] | 3 | 2022-03-03T09:14:50.000Z | 2022-03-28T13:46:29.000Z | utils/pysot/datasets/vot.py | ywang-37/EnhancedSiamShipTracking | 0b25cf02b6088268a6c374cb20a7f0355bc65b2e | [
"Apache-2.0"
] | null | null | null | utils/pysot/datasets/vot.py | ywang-37/EnhancedSiamShipTracking | 0b25cf02b6088268a6c374cb20a7f0355bc65b2e | [
"Apache-2.0"
] | null | null | null | import os
import json
import numpy as np
from glob import glob
from tqdm import tqdm
from .dataset import Dataset
from .video import Video
class VOTVideo(Video):
"""
Args:
name: video name
root: dataset root
video_dir: video directory
init_rect: init rectangle
img_nam... | 38.512397 | 98 | 0.516094 | import os
import json
import numpy as np
from glob import glob
from tqdm import tqdm
from .dataset import Dataset
from .video import Video
class VOTVideo(Video):
def __init__(self, name, root, video_dir, init_rect, img_names, gt_rect,
camera_motion, illum_change, motion_change, size_change, occlusio... | true | true |
f7fde4866974141f0e894bdffffd34c63e8823ff | 1,390 | py | Python | server/alembic/versions/3b121603bb7c_add_user_table.py | josenava/meal-calendar | d5182f9b9ee30c02efc8bd22e79bb7a53e778919 | [
"MIT"
] | null | null | null | server/alembic/versions/3b121603bb7c_add_user_table.py | josenava/meal-calendar | d5182f9b9ee30c02efc8bd22e79bb7a53e778919 | [
"MIT"
] | 5 | 2020-07-24T14:45:31.000Z | 2022-02-27T09:49:55.000Z | server/alembic/versions/3b121603bb7c_add_user_table.py | josenava/meal-calendar | d5182f9b9ee30c02efc8bd22e79bb7a53e778919 | [
"MIT"
] | null | null | null | """Add user table
Revision ID: 3b121603bb7c
Revises:
Create Date: 2020-07-20 16:52:16.928316
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.schema import Sequence, CreateSequence, DropSequence
# revision identifiers, used by Alembic.
revision = '3b121603bb7c'
down_revision = None
branch_labels ... | 32.325581 | 100 | 0.690647 | from alembic import op
import sqlalchemy as sa
from sqlalchemy.schema import Sequence, CreateSequence, DropSequence
revision = '3b121603bb7c'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
alse),
sa.Column('email', sa.String(), nullable=True),
sa.Column('hashed_password', sa... | true | true |
f7fde4f0aa746574dd27a0c9722065bb924d28a3 | 16,227 | py | Python | research/tcn/dataset/webcam.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/tcn/dataset/webcam.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/tcn/dataset/webcam.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"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 applicab... | 32.848178 | 80 | 0.668824 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import multiprocessing
import os
import subprocess
import sys
import time
from multiprocessing import Process
import cv2
import matplotlib
matplotlib.use('TkAgg')
from matplotlib import animati... | true | true |
f7fde73a4819b3f8fbcb8114c24be6c3c3692def | 10,920 | py | Python | tests/unit/stats/test_measure_to_view_map.py | zeako/opencensus-python | 5331d7476edd4af65885295f10d23b7864e5e741 | [
"Apache-2.0"
] | null | null | null | tests/unit/stats/test_measure_to_view_map.py | zeako/opencensus-python | 5331d7476edd4af65885295f10d23b7864e5e741 | [
"Apache-2.0"
] | null | null | null | tests/unit/stats/test_measure_to_view_map.py | zeako/opencensus-python | 5331d7476edd4af65885295f10d23b7864e5e741 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 40.295203 | 88 | 0.671978 |
import unittest
import mock
import logging
from datetime import datetime
from opencensus.stats.view import View
from opencensus.stats.view_data import ViewData
from opencensus.stats.measurement import Measurement
from opencensus.stats.measure import BaseMeasure
from opencensus.stats.measure import Measure... | true | true |
f7fde7796f27f83f7053daafb1f649030d0b77c6 | 10,925 | py | Python | egs/yesno/ASR/local/prepare_lang.py | TIFOSI528/icefall | 6f7860a0a60b53026216fa4ba19048955951333e | [
"Apache-2.0"
] | 173 | 2021-07-01T03:36:53.000Z | 2022-03-30T09:17:51.000Z | egs/yesno/ASR/local/prepare_lang.py | TIFOSI528/icefall | 6f7860a0a60b53026216fa4ba19048955951333e | [
"Apache-2.0"
] | 200 | 2021-07-01T03:14:19.000Z | 2022-03-31T13:15:07.000Z | egs/yesno/ASR/local/prepare_lang.py | TIFOSI528/icefall | 6f7860a0a60b53026216fa4ba19048955951333e | [
"Apache-2.0"
] | 57 | 2021-07-15T09:38:09.000Z | 2022-03-29T02:03:48.000Z | #!/usr/bin/env python3
# Copyright (c) 2021 Xiaomi Corporation (authors: Fangjun Kuang)
"""
This script takes as input a lexicon file "data/lang_phone/lexicon.txt"
consisting of words and tokens (i.e., phones) and does the following:
1. Add disambiguation symbols to the lexicon and generate lexicon_disambig.txt
2... | 29.6875 | 80 | 0.633501 |
import math
from collections import defaultdict
from pathlib import Path
from typing import Any, Dict, List, Tuple
import k2
import torch
from icefall.lexicon import read_lexicon, write_lexicon
Lexicon = List[Tuple[str, List[str]]]
def write_mapping(filename: str, sym2id: Dict[str, int]) -> None:
with open... | true | true |
f7fde7d735d6d8204161c6f69f919f7466338266 | 1,591 | py | Python | nasa_background.py | Thomas9292/nasa-background | 65cd238f780f76165af68eb2cba92a68b10ff643 | [
"MIT"
] | 20 | 2019-12-24T13:22:19.000Z | 2020-01-26T01:23:41.000Z | nasa_background.py | Thomas9292/nasa-background | 65cd238f780f76165af68eb2cba92a68b10ff643 | [
"MIT"
] | 13 | 2019-12-22T18:03:35.000Z | 2020-01-14T08:55:22.000Z | nasa_background.py | Thomas9292/nasa-background | 65cd238f780f76165af68eb2cba92a68b10ff643 | [
"MIT"
] | 7 | 2019-12-24T16:18:44.000Z | 2019-12-25T14:22:32.000Z | from datetime import datetime
import click
from tools import background, nasa_api
from tools.utils import parse_str_to_date
@click.group()
def nasa_background():
pass
@nasa_background.command()
@click.option("--date",
default=None,
help="Enter the date as a single string in YYYYMMD... | 32.469388 | 116 | 0.659962 | from datetime import datetime
import click
from tools import background, nasa_api
from tools.utils import parse_str_to_date
@click.group()
def nasa_background():
pass
@nasa_background.command()
@click.option("--date",
default=None,
help="Enter the date as a single string in YYYYMMD... | true | true |
f7fde8a0153e5f47b6098d1748aa541f4af9a7f2 | 964 | py | Python | vortidplenigilo.py | corcra/esperanto | be8f6eda63c4f20b6f7667a50f9b85d3dba32258 | [
"MIT"
] | 15 | 2015-11-15T15:15:55.000Z | 2018-05-05T19:13:01.000Z | vortidplenigilo.py | corcra/esperanto | be8f6eda63c4f20b6f7667a50f9b85d3dba32258 | [
"MIT"
] | 1 | 2015-11-19T15:11:32.000Z | 2015-11-19T15:12:06.000Z | vortidplenigilo.py | corcra/esperanto | be8f6eda63c4f20b6f7667a50f9b85d3dba32258 | [
"MIT"
] | 2 | 2015-11-28T13:15:35.000Z | 2016-03-03T09:24:17.000Z | #!/usr/bin/env ipython
# coding=utf-8
# This is intended to be run on a cronjob
from __future__ import print_function
import tweepy
from creds import consumer_key, consumer_secret, access_token, access_token_secret
from soup import tweet_soup
from parse_EO_full import eo_to_en
import random
# --- set up API --- #
au... | 27.542857 | 82 | 0.708506 |
from __future__ import print_function
import tweepy
from creds import consumer_key, consumer_secret, access_token, access_token_secret
from soup import tweet_soup
from parse_EO_full import eo_to_en
import random
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_t... | true | true |
f7fdea1735672e981febba7e392ec581a9562beb | 3,155 | py | Python | nova/console/websocketproxy.py | NetApp/nova | ca490d48a762a423449c654d5a7caeadecf2f6ca | [
"Apache-2.0"
] | 2 | 2015-11-05T04:52:34.000Z | 2016-03-07T03:00:06.000Z | nova/console/websocketproxy.py | NetApp/nova | ca490d48a762a423449c654d5a7caeadecf2f6ca | [
"Apache-2.0"
] | 1 | 2018-01-19T07:50:49.000Z | 2018-01-19T07:50:49.000Z | nova/console/websocketproxy.py | NetApp/nova | ca490d48a762a423449c654d5a7caeadecf2f6ca | [
"Apache-2.0"
] | 1 | 2020-07-24T07:32:11.000Z | 2020-07-24T07:32:11.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation
# 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.a... | 35.055556 | 78 | 0.602536 |
import Cookie
import socket
import websockify
from nova.consoleauth import rpcapi as consoleauth_rpcapi
from nova import context
from nova.openstack.common import log as logging
LOG = logging.getLogger(__name__)
class NovaWebSocketProxy(websockify.WebSocketProxy):
def __init__(self, *args, **... | true | true |
f7fdeaa94cc732b4dc7be6a8f88249870c0a181f | 242 | py | Python | airbyte-integrations/connectors/source-faker/main.py | kattos-aws/airbyte | cbcbab4a2399c08d8f66d1b693ac824c245ba3da | [
"MIT"
] | 1 | 2022-03-16T22:53:06.000Z | 2022-03-16T22:53:06.000Z | airbyte-integrations/connectors/source-faker/main.py | kattos-aws/airbyte | cbcbab4a2399c08d8f66d1b693ac824c245ba3da | [
"MIT"
] | 1 | 2021-12-08T21:39:05.000Z | 2021-12-09T17:10:45.000Z | airbyte-integrations/connectors/source-faker/main.py | kattos-aws/airbyte | cbcbab4a2399c08d8f66d1b693ac824c245ba3da | [
"MIT"
] | 1 | 2022-02-19T17:22:50.000Z | 2022-02-19T17:22:50.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import sys
from airbyte_cdk.entrypoint import launch
from source_faker import SourceFaker
if __name__ == "__main__":
source = SourceFaker()
launch(source, sys.argv[1:])
| 17.285714 | 56 | 0.72314 |
import sys
from airbyte_cdk.entrypoint import launch
from source_faker import SourceFaker
if __name__ == "__main__":
source = SourceFaker()
launch(source, sys.argv[1:])
| true | true |
f7fdeb2255b5885a6f541831d92b117383847c96 | 1,596 | py | Python | vat.py | awesome-archive/ssl-suite | 03990c5e86432c3f475971aeaf1ff7f7821ef40c | [
"Apache-2.0"
] | null | null | null | vat.py | awesome-archive/ssl-suite | 03990c5e86432c3f475971aeaf1ff7f7821ef40c | [
"Apache-2.0"
] | null | null | null | vat.py | awesome-archive/ssl-suite | 03990c5e86432c3f475971aeaf1ff7f7821ef40c | [
"Apache-2.0"
] | null | null | null | import torch
from homura.modules import cross_entropy_with_softlabels
from torch.distributions import Categorical
from torch.nn import functional as F
from backends.loss import _kl, _l2_normalize
from backends.utils import SSLTrainerBase, disable_bn_stats, get_task
class VATTrainer(SSLTrainerBase):
def labeled(s... | 33.957447 | 78 | 0.642231 | import torch
from homura.modules import cross_entropy_with_softlabels
from torch.distributions import Categorical
from torch.nn import functional as F
from backends.loss import _kl, _l2_normalize
from backends.utils import SSLTrainerBase, disable_bn_stats, get_task
class VATTrainer(SSLTrainerBase):
def labeled(s... | true | true |
f7fdeb55bc0326c1b03424292a432a31dc7976f6 | 769 | pyde | Python | sketches/colldectrect/colldectrect.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/colldectrect/colldectrect.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/colldectrect/colldectrect.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | from enemies import Enemy
from player import Player
def setup():
global enemy, player
size(420, 420)
this.surface.setTitle("Rectangle Collision Detection")
enemy = Enemy(width/2 - 64, height/2 - 32)
player = Player(20, 20)
def draw():
global enemy, player
background("#95ee0f5")
if rect... | 24.806452 | 58 | 0.592978 | from enemies import Enemy
from player import Player
def setup():
global enemy, player
size(420, 420)
this.surface.setTitle("Rectangle Collision Detection")
enemy = Enemy(width/2 - 64, height/2 - 32)
player = Player(20, 20)
def draw():
global enemy, player
background("#95ee0f5")
if rect... | true | true |
f7fdeb67125e77e9af71a01a0d25eb34834a9b5b | 1,866 | py | Python | python/maheen_code/dump_big_nn.py | maheenRashid/caffe | 82d7b1f19f49942be1f9a8d60bf3afa52c01c300 | [
"BSD-2-Clause"
] | null | null | null | python/maheen_code/dump_big_nn.py | maheenRashid/caffe | 82d7b1f19f49942be1f9a8d60bf3afa52c01c300 | [
"BSD-2-Clause"
] | null | null | null | python/maheen_code/dump_big_nn.py | maheenRashid/caffe | 82d7b1f19f49942be1f9a8d60bf3afa52c01c300 | [
"BSD-2-Clause"
] | null | null | null | FOR getNNIndicesForBigFeatureMats experiments_hashing
out_dir='/disk2/decemberExperiments/gettingNN';
out_dir_featureMats=os.path.join(out_dir,'big_feature_mats');
meta_replace=['/feature_mats','/feature_mats_meta']
big_feature_files=[os.path.join(out_dir_featureMats,file_curr) for file_curr i... | 36.588235 | 147 | 0.664523 | FOR getNNIndicesForBigFeatureMats experiments_hashing
out_dir='/disk2/decemberExperiments/gettingNN';
out_dir_featureMats=os.path.join(out_dir,'big_feature_mats');
meta_replace=['/feature_mats','/feature_mats_meta']
big_feature_files=[os.path.join(out_dir_featureMats,file_curr) for file_curr i... | false | true |
f7fdeccac279b16a83abefacf96e6b863d155121 | 6,534 | py | Python | applications/popart/bert/tests/unit/pytorch/nsp_test.py | Alwaysproblem/examples-1 | 9754fa63ed1931489a21ac1f5b299f945e369a5c | [
"MIT"
] | null | null | null | applications/popart/bert/tests/unit/pytorch/nsp_test.py | Alwaysproblem/examples-1 | 9754fa63ed1931489a21ac1f5b299f945e369a5c | [
"MIT"
] | null | null | null | applications/popart/bert/tests/unit/pytorch/nsp_test.py | Alwaysproblem/examples-1 | 9754fa63ed1931489a21ac1f5b299f945e369a5c | [
"MIT"
] | null | null | null | # Copyright (c) 2019 Graphcore Ltd. 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 l... | 40.08589 | 125 | 0.573309 |
import torch
import popart
import numpy as np
import pytest
from bert_model import BertConfig, ExecutionMode, get_model
from tests.torch_bert import BertConfig as TorchBertConfig, BertForNextSentencePrediction
from .full_graph_utils import fwd_graph, bwd_graph
NSP_MAPPING = {}
NSP_MAPPING[ExecutionMo... | true | true |
f7fded9f3af8883ffa64d1e202e66ca6ad448c9d | 3,342 | py | Python | imperative/python/megengine/data/collator.py | Olalaye/MegEngine | 695d24f24517536e6544b07936d189dbc031bbce | [
"Apache-2.0"
] | 5,168 | 2020-03-19T06:10:04.000Z | 2022-03-31T11:11:54.000Z | imperative/python/megengine/data/collator.py | Olalaye/MegEngine | 695d24f24517536e6544b07936d189dbc031bbce | [
"Apache-2.0"
] | 286 | 2020-03-25T01:36:23.000Z | 2022-03-31T10:26:33.000Z | imperative/python/megengine/data/collator.py | Olalaye/MegEngine | 695d24f24517536e6544b07936d189dbc031bbce | [
"Apache-2.0"
] | 515 | 2020-03-19T06:10:05.000Z | 2022-03-30T09:15:59.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2016- Facebook, Inc (Adam Paszke)
# Copyright (c) 2014- Facebook, Inc (Soumith Chintala)
# Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert)
# Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu)
# Copyright (c) 2011-... | 46.416667 | 125 | 0.637044 |
import collections.abc
import re
import numpy as np
np_str_obj_array_pattern = re.compile(r"[aO]")
default_collate_err_msg_format = (
"default_collator: inputs must contain numpy arrays, numbers, "
"Unicode strings, bytes, dicts or lists; found {}"
)
class Collator:
def apply(self... | true | true |
f7fdeeb67a2fbce41bcc6ad078ed73378c5f4ef6 | 812 | py | Python | launch/stereo_frame_capture.launch.py | aussierobots/galaxy_camera_u3v | c60722042b3685caeeaaac9d98215bb3f2883a34 | [
"Apache-2.0"
] | 2 | 2021-09-04T19:40:48.000Z | 2021-09-11T09:50:51.000Z | launch/stereo_frame_capture.launch.py | aussierobots/galaxy_camera_u3v | c60722042b3685caeeaaac9d98215bb3f2883a34 | [
"Apache-2.0"
] | null | null | null | launch/stereo_frame_capture.launch.py | aussierobots/galaxy_camera_u3v | c60722042b3685caeeaaac9d98215bb3f2883a34 | [
"Apache-2.0"
] | null | null | null | """Launch uv3_image_pub stereo left & right in a component container."""
import launch
from launch_ros.actions import ComposableNodeContainer
from launch_ros.actions import LoadComposableNodes
from launch_ros.descriptions import ComposableNode
def generate_launch_description():
"""Generate launch description with m... | 29 | 72 | 0.741379 |
import launch
from launch_ros.actions import ComposableNodeContainer
from launch_ros.actions import LoadComposableNodes
from launch_ros.descriptions import ComposableNode
def generate_launch_description():
params=[{'image_path': '/tmp'}]
container1 = ComposableNodeContainer(
name='stereo_frame_capture',
... | true | true |
f7fdeff7c15b7a324a2fb182504f08c5fbea5a73 | 4,617 | py | Python | preprocess/video_generator.py | wustone1995/speech2face | 0eadbc8caf59c58cf5320a0a131a5e6fc9e728b8 | [
"MIT"
] | null | null | null | preprocess/video_generator.py | wustone1995/speech2face | 0eadbc8caf59c58cf5320a0a131a5e6fc9e728b8 | [
"MIT"
] | 6 | 2020-09-25T22:34:18.000Z | 2022-03-12T00:17:46.000Z | preprocess/video_generator.py | wustone1995/speech2face | 0eadbc8caf59c58cf5320a0a131a5e6fc9e728b8 | [
"MIT"
] | 1 | 2021-01-02T10:18:06.000Z | 2021-01-02T10:18:06.000Z | import os
import pickle
import shutil
import imageio
import pandas as pd
import subprocess
from PIL import Image
import face_recognition
import numpy as np
import skimage
import scipy
from keras.engine import Model
from keras.layers import Input
from keras_vggface.vggface import VGGFace
from keras_vggfac... | 43.971429 | 168 | 0.568118 | import os
import pickle
import shutil
import imageio
import pandas as pd
import subprocess
from PIL import Image
import face_recognition
import numpy as np
import skimage
import scipy
from keras.engine import Model
from keras.layers import Input
from keras_vggface.vggface import VGGFace
from keras_vggfac... | true | true |
f7fdf01c194b31505661a0bd103e53ec3c595d54 | 8,894 | py | Python | src/server.py | drobnymichal/ChatServerUnixSocket | 9fb7693ef45486d5cd3255fc1eed3a42cd76a7b0 | [
"MIT"
] | null | null | null | src/server.py | drobnymichal/ChatServerUnixSocket | 9fb7693ef45486d5cd3255fc1eed3a42cd76a7b0 | [
"MIT"
] | null | null | null | src/server.py | drobnymichal/ChatServerUnixSocket | 9fb7693ef45486d5cd3255fc1eed3a42cd76a7b0 | [
"MIT"
] | null | null | null | import asyncio, socket, time
import collections
from inspect import stack
import os
from typing import AsyncIterator, Deque, List, Optional, Tuple, Union, Dict
from collections import deque
class Client:
def __init__(self, writer: asyncio.StreamWriter, reader: asyncio.StreamReader) -> None:
self.name = ... | 42.759615 | 214 | 0.560265 | import asyncio, socket, time
import collections
from inspect import stack
import os
from typing import AsyncIterator, Deque, List, Optional, Tuple, Union, Dict
from collections import deque
class Client:
def __init__(self, writer: asyncio.StreamWriter, reader: asyncio.StreamReader) -> None:
self.name = ... | true | true |
f7fdf04c4e0a3593983a55cd2f8bc0a6c7ae5bd1 | 1,570 | py | Python | main/migrations/0007_auto_20190325_1437.py | SimonF24/ChironLearning | 42cb7bc8b277d0bbad712d7bc60e9acf511f4a25 | [
"Unlicense"
] | null | null | null | main/migrations/0007_auto_20190325_1437.py | SimonF24/ChironLearning | 42cb7bc8b277d0bbad712d7bc60e9acf511f4a25 | [
"Unlicense"
] | 3 | 2020-06-06T01:55:54.000Z | 2021-06-10T22:58:02.000Z | main/migrations/0007_auto_20190325_1437.py | SimonF24/ChironLearning | 42cb7bc8b277d0bbad712d7bc60e9acf511f4a25 | [
"Unlicense"
] | null | null | null | # Generated by Django 2.1.7 on 2019-03-25 21:37
import constrainedfilefield.fields.file
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import main.models
class Migration(migrations.Migration):
dependencies = [
('main', '0006_auto_20190316_1034'... | 31.4 | 226 | 0.611465 |
import constrainedfilefield.fields.file
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import main.models
class Migration(migrations.Migration):
dependencies = [
('main', '0006_auto_20190316_1034'),
]
operations = [
migrations... | true | true |
f7fdf079db52e320528a5a9fbc15b538be3b2556 | 2,918 | py | Python | huaweicloud-sdk-mrs/huaweicloudsdkmrs/v1/model/create_cluster_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-mrs/huaweicloudsdkmrs/v1/model/create_cluster_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-mrs/huaweicloudsdkmrs/v1/model/create_cluster_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class CreateClusterRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The k... | 25.823009 | 79 | 0.540439 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class CreateClusterRequest:
sensitive_list = []
openapi_types = {
'body': 'CreateClusterReq'
}
attribute_map = {
'body': 'body'
}
def __init__(self, body=None):
... | true | true |
f7fdf0d3ecb1fad427f7ad0d8c52af380cf83871 | 396 | py | Python | top/api/rest/TmcMessagesConfirmRequest.py | looio/jst | 9d8e5bb7018ad8eeef36b233cd5e076106078f80 | [
"MIT"
] | null | null | null | top/api/rest/TmcMessagesConfirmRequest.py | looio/jst | 9d8e5bb7018ad8eeef36b233cd5e076106078f80 | [
"MIT"
] | null | null | null | top/api/rest/TmcMessagesConfirmRequest.py | looio/jst | 9d8e5bb7018ad8eeef36b233cd5e076106078f80 | [
"MIT"
] | null | null | null | '''
Created by auto_sdk on 2015.12.17
'''
from top.api.base import RestApi
class TmcMessagesConfirmRequest(RestApi):
def __init__(self, domain='gw.api.taobao.com', port=80):
RestApi.__init__(self, domain, port)
self.f_message_ids = None
self.group_name = None
self.s_message_ids = N... | 24.75 | 60 | 0.676768 | from top.api.base import RestApi
class TmcMessagesConfirmRequest(RestApi):
def __init__(self, domain='gw.api.taobao.com', port=80):
RestApi.__init__(self, domain, port)
self.f_message_ids = None
self.group_name = None
self.s_message_ids = None
def getapiname(self):
ret... | true | true |
f7fdf1b055d9e0a963c8a8f1f112c0a42f9881aa | 4,963 | py | Python | app/users/views.py | jayjodev/oncollegehub | 5633df8beaef232d58025c4407bd9e25bd349e49 | [
"MIT"
] | 2 | 2018-11-14T17:08:05.000Z | 2018-11-14T17:08:38.000Z | app/users/views.py | jayjodev/oncollegehub | 5633df8beaef232d58025c4407bd9e25bd349e49 | [
"MIT"
] | 16 | 2020-01-11T04:09:50.000Z | 2022-03-12T00:11:19.000Z | app/users/views.py | jayjodev/oncollegehub | 5633df8beaef232d58025c4407bd9e25bd349e49 | [
"MIT"
] | 2 | 2018-11-14T17:08:07.000Z | 2018-11-28T21:38:16.000Z | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.http import HttpResponseRedirect
from django.contrib.auth.mixins import LoginRequiredMixin, User... | 34.706294 | 109 | 0.683055 | from django.shortcuts import render, redirect, get_object_or_404
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from django.http import HttpResponseRedirect
from django.contrib.auth.mixins import LoginRequiredMixin, User... | true | true |
f7fdf2460dad1af95cb06a8fdbfb287af7d94c68 | 959 | py | Python | lend/models.py | harshitanand/Libmgmt | a2a7537b07dd960b620198708714f036345b2395 | [
"MIT"
] | 1 | 2015-04-28T08:40:00.000Z | 2015-04-28T08:40:00.000Z | lend/models.py | harshitanand/Libmgmt | a2a7537b07dd960b620198708714f036345b2395 | [
"MIT"
] | null | null | null | lend/models.py | harshitanand/Libmgmt | a2a7537b07dd960b620198708714f036345b2395 | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class Books(models.Model):
name = models.CharField(max_length=255, blank=False, unique=True)
author = models.CharField(max_length=255, blank=False)
copies = models.IntegerField(blank=False, default=1)
status = models.BooleanField(blank=False, def... | 31.966667 | 73 | 0.726799 | from django.db import models
class Books(models.Model):
name = models.CharField(max_length=255, blank=False, unique=True)
author = models.CharField(max_length=255, blank=False)
copies = models.IntegerField(blank=False, default=1)
status = models.BooleanField(blank=False, default=True)
def __str_... | true | true |
f7fdf34cb999122cc1a1bd62fe452838b0e311c7 | 2,475 | py | Python | IoT_ShadowApplications/my_app/UsefulData.py | ertis-research/reliable-iot | c7a1f6bb69099797e2136522dbdda94c2e6a4895 | [
"MIT"
] | 1 | 2019-04-26T10:28:57.000Z | 2019-04-26T10:28:57.000Z | IoT_ShadowApplications/my_app/UsefulData.py | ertis-research/reliable-iot | c7a1f6bb69099797e2136522dbdda94c2e6a4895 | [
"MIT"
] | null | null | null | IoT_ShadowApplications/my_app/UsefulData.py | ertis-research/reliable-iot | c7a1f6bb69099797e2136522dbdda94c2e6a4895 | [
"MIT"
] | 1 | 2019-04-26T10:29:35.000Z | 2019-04-26T10:29:35.000Z | """This is a singleton class to store the component token database urls and kafka Producer & Consumer"""
from kafka import KafkaAdminClient, KafkaProducer
import requests
import json
class URL:
# DB_URL = 'http://127.0.0.1:8084/' # on local for tests
DB_URL = 'http://mongoapi:80/' # on docker swarm
class... | 29.464286 | 104 | 0.574545 |
from kafka import KafkaAdminClient, KafkaProducer
import requests
import json
class URL:
//mongoapi:80/'
class Token:
__instance = None
@staticmethod
def get_instance():
if not Token.__instance:
Token()
return Token.__instance
def __init__(self):
if Toke... | true | true |
f7fdf400ff2f46e396f4224c552a0ad3c77feaf3 | 18,953 | py | Python | mpf/platforms/system11.py | garimahc15/mpf | 62acdd4110fa6bc7ac2d97ad4216fdc60076d001 | [
"MIT"
] | null | null | null | mpf/platforms/system11.py | garimahc15/mpf | 62acdd4110fa6bc7ac2d97ad4216fdc60076d001 | [
"MIT"
] | null | null | null | mpf/platforms/system11.py | garimahc15/mpf | 62acdd4110fa6bc7ac2d97ad4216fdc60076d001 | [
"MIT"
] | null | null | null | """A generic system11 driver overlay.
This is based on the Snux platform to generically support all kinds of System11 platforms.
"""
import asyncio
from typing import Any, Optional, Set, Tuple, Dict
from mpf.core.machine import MachineController
from mpf.core.platform import DriverPlatform, DriverConfig
from mpf.pl... | 39.733753 | 120 | 0.617528 | import asyncio
from typing import Any, Optional, Set, Tuple, Dict
from mpf.core.machine import MachineController
from mpf.core.platform import DriverPlatform, DriverConfig
from mpf.platforms.interfaces.driver_platform_interface import DriverPlatformInterface, PulseSettings, HoldSettings
from mpf.core.delays import ... | true | true |
f7fdf4ed857b34eeab39209bf3a6cbf8a77dce20 | 527 | py | Python | leetcode/0013/Untitled-1.py | bluove/note-on-cs | 46e4ee1a2c00c0ed717af828013d42306c62061c | [
"MIT"
] | null | null | null | leetcode/0013/Untitled-1.py | bluove/note-on-cs | 46e4ee1a2c00c0ed717af828013d42306c62061c | [
"MIT"
] | null | null | null | leetcode/0013/Untitled-1.py | bluove/note-on-cs | 46e4ee1a2c00c0ed717af828013d42306c62061c | [
"MIT"
] | null | null | null | class Solution:
def romanToInt(self, s):
"""
:type s: str
:rtype: int
"""
s = s.replace('CM','DCCCC')
s = s.replace('CD','CCCC')
s = s.replace('XC','LXXXX')
s = s.replace('XL','XXXX')
s = s.replace('IX','VIIII')
s = s.replace('... | 26.35 | 85 | 0.426945 | class Solution:
def romanToInt(self, s):
s = s.replace('CM','DCCCC')
s = s.replace('CD','CCCC')
s = s.replace('XC','LXXXX')
s = s.replace('XL','XXXX')
s = s.replace('IX','VIIII')
s = s.replace('IV','IIII')
Roman_2_Int_dict = {'M':1000, 'D':50... | true | true |
f7fdf6002abe53d95cd09c73dfb7187f5eeadf0e | 1,366 | py | Python | recipe_parser/recipes/mykitchen101en.py | tyler-a-cox/recipe-parsing | fa883f66a39063cf72912527628b082cda455e76 | [
"MIT"
] | null | null | null | recipe_parser/recipes/mykitchen101en.py | tyler-a-cox/recipe-parsing | fa883f66a39063cf72912527628b082cda455e76 | [
"MIT"
] | null | null | null | recipe_parser/recipes/mykitchen101en.py | tyler-a-cox/recipe-parsing | fa883f66a39063cf72912527628b082cda455e76 | [
"MIT"
] | null | null | null | import re
from bs4 import BeautifulSoup
from ._schema import DefaultSchema
from ._utils import get_yields, normalize_string
class MyKitchen101en(DefaultSchema):
@classmethod
def host(cls):
return "mykitchen101en.com"
def author(self):
return self.soup.find("a", {"rel": "author"}).get_te... | 29.06383 | 86 | 0.598097 | import re
from bs4 import BeautifulSoup
from ._schema import DefaultSchema
from ._utils import get_yields, normalize_string
class MyKitchen101en(DefaultSchema):
@classmethod
def host(cls):
return "mykitchen101en.com"
def author(self):
return self.soup.find("a", {"rel": "author"}).get_te... | true | true |
f7fdf6170b08523e3a50200f1c862c9425a71680 | 4,854 | py | Python | src/software/backend/backend/settings/base.py | bytecod3/votingBooth | 6a248833b34885a1d6b62b5d1ee7a60baba769e9 | [
"MIT"
] | 2 | 2021-06-06T05:07:34.000Z | 2021-08-30T08:56:41.000Z | src/software/backend/backend/settings/base.py | bytecod3/votingBooth | 6a248833b34885a1d6b62b5d1ee7a60baba769e9 | [
"MIT"
] | null | null | null | src/software/backend/backend/settings/base.py | bytecod3/votingBooth | 6a248833b34885a1d6b62b5d1ee7a60baba769e9 | [
"MIT"
] | null | null | null | """
Django settings for backend project.
Generated by 'django-admin startproject' using Django 3.2.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib... | 26.52459 | 91 | 0.721261 |
from pathlib import Path
import os
BASE_DIR = Path(__file__).resolve().parent.parent.parent
SECRET_KEY = 'django-insecure-rf1mfkvesu-n0+kptvnw5ye-e%nqgs0s5&&j9%^5o690eui@^n'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
... | true | true |
f7fdf6d5616de0b1c5066237e5e6ec52b729404b | 544 | py | Python | MicroPython_BUILD/components/micropython/esp32/modules/refresh_wd.py | linus-gates/mp | 8f55cd4e6c91d02c527ac4bc636e3b6cc7109137 | [
"Apache-2.0"
] | null | null | null | MicroPython_BUILD/components/micropython/esp32/modules/refresh_wd.py | linus-gates/mp | 8f55cd4e6c91d02c527ac4bc636e3b6cc7109137 | [
"Apache-2.0"
] | null | null | null | MicroPython_BUILD/components/micropython/esp32/modules/refresh_wd.py | linus-gates/mp | 8f55cd4e6c91d02c527ac4bc636e3b6cc7109137 | [
"Apache-2.0"
] | null | null | null | import machine
import time
import _thread
GPIO_NUM = 5
def set(num):
pin = machine.Pin(num, machine.Pin.OUT)
pin.value(1)
def reset(num):
pin = machine.Pin(num, machine.Pin.OUT)
pin.value(0)
def rfs_wd():
print("refreshing watchdog")
while (True):
set(GPIO_NUM)
time.sleep(3... | 18.133333 | 54 | 0.648897 | import machine
import time
import _thread
GPIO_NUM = 5
def set(num):
pin = machine.Pin(num, machine.Pin.OUT)
pin.value(1)
def reset(num):
pin = machine.Pin(num, machine.Pin.OUT)
pin.value(0)
def rfs_wd():
print("refreshing watchdog")
while (True):
set(GPIO_NUM)
time.sleep(3... | true | true |
f7fdf7ae94165cb7b080eeb00b8515a57a053e1a | 2,476 | py | Python | docs/development_guide/source/conf.py | HuakeZhBo/bl_mcu_sdk | a6a7f077e5dd535419d1741e4c2f5215eebb699d | [
"Apache-2.0"
] | 93 | 2021-04-27T07:34:49.000Z | 2022-03-22T08:43:44.000Z | docs/development_guide/source/conf.py | zeroherolin/bl_mcu_sdk | 97760e3633d7ce0f435be1d98e7c9e8c46bfaca7 | [
"Apache-2.0"
] | 18 | 2021-05-23T14:10:12.000Z | 2022-03-30T09:18:39.000Z | docs/development_guide/source/conf.py | zeroherolin/bl_mcu_sdk | 97760e3633d7ce0f435be1d98e7c9e8c46bfaca7 | [
"Apache-2.0"
] | 33 | 2021-04-27T07:46:50.000Z | 2022-02-27T05:45:19.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
... | 32.155844 | 80 | 0.653069 |
project = 'BL_MCU_SDK 开发指南'
copyright = '2021, BouffaloLab Co., Ltd'
author = 'BouffaloLab MCU Team'
version = '0.3'
release = '0.3'
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.imgmath',
]
templates_path = ['_templates']
source_suffix = '.rst'
master... | true | true |
f7fdf95e95e2ae92fce054e58bc59bf5ecffe6aa | 9,389 | py | Python | env/lib/python3.8/site-packages/plotly/validators/scatterpolargl/marker/_symbol.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2 | 2021-07-07T20:16:23.000Z | 2021-07-14T14:03:09.000Z | env/lib/python3.8/site-packages/plotly/validators/scatterpolargl/marker/_symbol.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 5 | 2020-06-05T20:56:21.000Z | 2021-09-22T19:12:42.000Z | env/lib/python3.8/site-packages/plotly/validators/scatterpolargl/marker/_symbol.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2 | 2020-07-05T12:57:14.000Z | 2020-07-05T12:58:00.000Z | import _plotly_utils.basevalidators
class SymbolValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="symbol", parent_name="scatterpolargl.marker", **kwargs
):
super(SymbolValidator, self).__init__(
plotly_name=plotly_name,
parent... | 30.783607 | 81 | 0.251358 | import _plotly_utils.basevalidators
class SymbolValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="symbol", parent_name="scatterpolargl.marker", **kwargs
):
super(SymbolValidator, self).__init__(
plotly_name=plotly_name,
parent... | true | true |
f7fdf9b878edb71799759b782250ba6cf99600c6 | 2,502 | py | Python | server/walt/server/threads/main/settings_manager.py | dia38/walt-python-packages | e6fa1f166f45e73173195d57840d22bef87b88f5 | [
"BSD-3-Clause"
] | null | null | null | server/walt/server/threads/main/settings_manager.py | dia38/walt-python-packages | e6fa1f166f45e73173195d57840d22bef87b88f5 | [
"BSD-3-Clause"
] | null | null | null | server/walt/server/threads/main/settings_manager.py | dia38/walt-python-packages | e6fa1f166f45e73173195d57840d22bef87b88f5 | [
"BSD-3-Clause"
] | null | null | null | # Handlers are generators. They are created with their parameters, which are
# always the requester, the device_set and the setting_value. Then, their code
# are divided in two parts: firstly, they check all conditions to ensure the
# setting is coherent, valid, available for the devices, etc. They yield a
# boolean... | 45.490909 | 97 | 0.642686 |
class SettingsHandler:
def __init__(self, server):
self.server = server
def set_device_config(self, requester, device_set, settings_args):
if len(settings_args) % 2 != 0:
requester.stderr.write(
"Provide settings as `<setting name> <setting value>`... | true | true |
f7fdf9ccd69e61bc51090ac810f97077cdc55228 | 41,594 | py | Python | jssh.py | fnhchaiyin/jssh | c6a3c339b3baea6cc25675739d68b855c624144e | [
"MIT"
] | null | null | null | jssh.py | fnhchaiyin/jssh | c6a3c339b3baea6cc25675739d68b855c624144e | [
"MIT"
] | null | null | null | jssh.py | fnhchaiyin/jssh | c6a3c339b3baea6cc25675739d68b855c624144e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# 报错信息为弹出框
#修改多线程
#执行进度优化
from Tkinter import *
from tkFileDialog import *
from threading import Thread,Semaphore
from datetime import datetime
import gl
from server import *
from ttk import Combobox
from tkFont import Font,NORMAL
# import atexit
from signal import signal,SIGTERM,SIGINT
import... | 45.657519 | 171 | 0.47014 |
from Tkinter import *
from tkFileDialog import *
from threading import Thread,Semaphore
from datetime import datetime
import gl
from server import *
from ttk import Combobox
from tkFont import Font,NORMAL
from signal import signal,SIGTERM,SIGINT
import sys
import os
from cPickle import dump,load
from time import *... | false | true |
f7fdfa57e32dfd0ee950023c731ee2d5825b1369 | 4,233 | py | Python | usaspending_api/common/management/commands/matview_runner.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | usaspending_api/common/management/commands/matview_runner.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | usaspending_api/common/management/commands/matview_runner.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | import asyncio
import logging
import psycopg2
import subprocess
from django.core.management.base import BaseCommand
from pathlib import Path
from usaspending_api.common.data_connectors.async_sql_query import async_run_creates
from usaspending_api.common.helpers.timing_helpers import Timer
from usaspending_api.common.... | 34.414634 | 117 | 0.647768 | import asyncio
import logging
import psycopg2
import subprocess
from django.core.management.base import BaseCommand
from pathlib import Path
from usaspending_api.common.data_connectors.async_sql_query import async_run_creates
from usaspending_api.common.helpers.timing_helpers import Timer
from usaspending_api.common.... | true | true |
f7fdfbe0771dca4c4180967e61b38ab3491eb32e | 692 | py | Python | migrations/versions/4f494d6d1000_added_purchase_date_to_the_stock_model.py | YellowFlash2012/stock-portfolio-io | 0a39c9a692aecc8d6b39e728efd63061112bc975 | [
"MIT"
] | null | null | null | migrations/versions/4f494d6d1000_added_purchase_date_to_the_stock_model.py | YellowFlash2012/stock-portfolio-io | 0a39c9a692aecc8d6b39e728efd63061112bc975 | [
"MIT"
] | null | null | null | migrations/versions/4f494d6d1000_added_purchase_date_to_the_stock_model.py | YellowFlash2012/stock-portfolio-io | 0a39c9a692aecc8d6b39e728efd63061112bc975 | [
"MIT"
] | null | null | null | """added purchase_date to the Stock model
Revision ID: 4f494d6d1000
Revises: df472f9e977f
Create Date: 2022-02-13 06:35:05.343296
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4f494d6d1000'
down_revision = 'df472f9e977f'
branch_labels = None
depends_on = Non... | 23.862069 | 85 | 0.702312 | from alembic import op
import sqlalchemy as sa
revision = '4f494d6d1000'
down_revision = 'df472f9e977f'
branch_labels = None
depends_on = None
def upgrade():
| true | true |
f7fdfbfb79e2eedab8854f28073d5e8bb50393cc | 30,421 | py | Python | pychron/dvc/dvc_persister.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | null | null | null | pychron/dvc/dvc_persister.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 1 | 2021-12-16T18:48:03.000Z | 2021-12-16T18:48:03.000Z | pychron/dvc/dvc_persister.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | 33.35636 | 100 | 0.514447 |
import hashlib
import os
import shutil
from datetime import datetime
from apptools.preferences.preference_binding import bind_preference
from git.exc import GitCommandError
from sqlalchemy.exc import OperationalError, DatabaseError
from traits.api import Instance, Bool, Str
from uncertainties import ... | true | true |
f7fdfc9633154d29d6fe5822b38b895623f50c65 | 420 | py | Python | consume.py | gonejack/pyscripts | 1c6a10b489e128de36567c384596954733c09e83 | [
"MIT"
] | null | null | null | consume.py | gonejack/pyscripts | 1c6a10b489e128de36567c384596954733c09e83 | [
"MIT"
] | null | null | null | consume.py | gonejack/pyscripts | 1c6a10b489e128de36567c384596954733c09e83 | [
"MIT"
] | null | null | null | import re
with open("/tmp/fifo") as fifo:
cache = {}
for line in fifo:
match = re.search(r"(201903\d{2}) (\d{2}:\d{2}:\d{2})", line)
if match:
date = match.group(1)
hour = match.group(2)
target = "./fixData/%s_%s" % (date, hour)
if target not in ... | 26.25 | 69 | 0.483333 | import re
with open("/tmp/fifo") as fifo:
cache = {}
for line in fifo:
match = re.search(r"(201903\d{2}) (\d{2}:\d{2}:\d{2})", line)
if match:
date = match.group(1)
hour = match.group(2)
target = "./fixData/%s_%s" % (date, hour)
if target not in ... | true | true |
f7fdfcd39461453f3a3073ff80cd3c20d8db35fd | 10,396 | py | Python | map_machine/ui/cli.py | Strubbl/map-machine | e2c6f8cd373bc5dba322129112cfa58874a8321b | [
"MIT"
] | 62 | 2021-09-18T02:37:03.000Z | 2022-03-21T22:58:35.000Z | map_machine/ui/cli.py | Strubbl/map-machine | e2c6f8cd373bc5dba322129112cfa58874a8321b | [
"MIT"
] | 77 | 2016-07-31T08:11:34.000Z | 2021-09-06T22:40:59.000Z | map_machine/ui/cli.py | Strubbl/map-machine | e2c6f8cd373bc5dba322129112cfa58874a8321b | [
"MIT"
] | 6 | 2021-10-13T07:27:21.000Z | 2022-02-10T03:57:29.000Z | """
Command-line user interface.
"""
import argparse
import sys
from map_machine import __version__
from map_machine.map_configuration import BuildingMode, DrawingMode, LabelMode
from map_machine.osm.osm_reader import STAGES_OF_DECAY
__author__ = "Sergey Vartanov"
__email__ = "me@enzet.ru"
BOXES: str = " ▏▎▍▌▋▊▉"
BO... | 28.797784 | 80 | 0.577722 | import argparse
import sys
from map_machine import __version__
from map_machine.map_configuration import BuildingMode, DrawingMode, LabelMode
from map_machine.osm.osm_reader import STAGES_OF_DECAY
__author__ = "Sergey Vartanov"
__email__ = "me@enzet.ru"
BOXES: str = " ▏▎▍▌▋▊▉"
BOXES_LENGTH: int = len(BOXES)
COMMAND... | true | true |
f7fe002baac1c1bbc3290fe084401ccf665443da | 395 | py | Python | realworld/asgi.py | rebornweb/realworld | 2ee84a6a06bd976b795119e700ee419fba1e2966 | [
"MIT"
] | 27 | 2022-01-29T16:18:19.000Z | 2022-03-29T12:43:47.000Z | realworld/asgi.py | rebornweb/realworld | 2ee84a6a06bd976b795119e700ee419fba1e2966 | [
"MIT"
] | 1 | 2022-02-08T23:50:10.000Z | 2022-02-09T11:05:00.000Z | realworld/asgi.py | rebornweb/realworld | 2ee84a6a06bd976b795119e700ee419fba1e2966 | [
"MIT"
] | 5 | 2022-02-09T11:05:19.000Z | 2022-03-24T07:35:43.000Z | """
ASGI config for realworld project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SET... | 23.235294 | 78 | 0.787342 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'realworld.settings')
application = get_asgi_application()
| true | true |
f7fe00a5405a1c019805694c4046c1320cb5acb3 | 33,026 | py | Python | apps/dash-web-trader/env/Lib/site-packages/plotly/validators/scatterternary/marker/__init__.py | alzo425/dash-sample-apps | d3e9f521a3bc2b8d39ed2922838ad35b9b17beb0 | [
"MIT"
] | 2 | 2019-10-23T08:14:26.000Z | 2019-10-23T08:14:27.000Z | apps/dash-web-trader/env/Lib/site-packages/plotly/validators/scatterternary/marker/__init__.py | alzo425/dash-sample-apps | d3e9f521a3bc2b8d39ed2922838ad35b9b17beb0 | [
"MIT"
] | null | null | null | apps/dash-web-trader/env/Lib/site-packages/plotly/validators/scatterternary/marker/__init__.py | alzo425/dash-sample-apps | d3e9f521a3bc2b8d39ed2922838ad35b9b17beb0 | [
"MIT"
] | 1 | 2021-02-02T02:56:39.000Z | 2021-02-02T02:56:39.000Z |
import _plotly_utils.basevalidators
class SymbolsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name='symbolsrc',
parent_name='scatterternary.marker',
**kwargs
):
super(SymbolsrcValidator, self).__init__(
plotly_name=pl... | 37.149606 | 79 | 0.548689 |
import _plotly_utils.basevalidators
class SymbolsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name='symbolsrc',
parent_name='scatterternary.marker',
**kwargs
):
super(SymbolsrcValidator, self).__init__(
plotly_name=pl... | true | true |
f7fe017c83c501bcc0aa1472abfbdea6955896c5 | 208 | py | Python | Kattis (Tae Ho Kim)/Triple Texting/Answer.py | kim4t/Kattis | 67a0aef92d65f5f9294e9a3338ef68e38e697c1c | [
"Unlicense"
] | null | null | null | Kattis (Tae Ho Kim)/Triple Texting/Answer.py | kim4t/Kattis | 67a0aef92d65f5f9294e9a3338ef68e38e697c1c | [
"Unlicense"
] | null | null | null | Kattis (Tae Ho Kim)/Triple Texting/Answer.py | kim4t/Kattis | 67a0aef92d65f5f9294e9a3338ef68e38e697c1c | [
"Unlicense"
] | null | null | null | s = input()
list = list(s)
l = len(list)//3
w1=''
w2=''
w3=''
for i in range(len(list)):
if(i<l): w1+=list[i]
elif(l<=i<2*l): w2+=list[i]
else: w3+=list[i]
if(w1==w2):
print(w1)
else:print(w3) | 16 | 31 | 0.524038 | s = input()
list = list(s)
l = len(list)//3
w1=''
w2=''
w3=''
for i in range(len(list)):
if(i<l): w1+=list[i]
elif(l<=i<2*l): w2+=list[i]
else: w3+=list[i]
if(w1==w2):
print(w1)
else:print(w3) | true | true |
f7fe019bf105ac77a2febfa8d277d5397ef387fd | 3,078 | py | Python | artsubj-from-npimport.py | rwst/wikidata-molbio | 198587fda16f81cf241c398650f79594c07cbdee | [
"CC0-1.0"
] | 2 | 2021-05-16T09:42:59.000Z | 2022-03-14T11:17:15.000Z | artsubj-from-npimport.py | rwst/wikidata-molbio | 198587fda16f81cf241c398650f79594c07cbdee | [
"CC0-1.0"
] | null | null | null | artsubj-from-npimport.py | rwst/wikidata-molbio | 198587fda16f81cf241c398650f79594c07cbdee | [
"CC0-1.0"
] | 1 | 2021-05-16T09:54:14.000Z | 2021-05-16T09:54:14.000Z |
import os, json, argparse, sys, datetime, time, csv
"""
"""
# Initiate the parser
parser = argparse.ArgumentParser()
parser.add_argument("-q", "--query", help="perform SPARQL query",
action="store_true")
# Read arguments from the command line
args = parser.parse_args()
# Check for --version or -V
dontquery ... | 30.176471 | 87 | 0.561079 |
import os, json, argparse, sys, datetime, time, csv
parser = argparse.ArgumentParser()
parser.add_argument("-q", "--query", help="perform SPARQL query",
action="store_true")
args = parser.parse_args()
dontquery = not args.query
script = os.path.basename(sys.argv[0])[:-3]
if dontquery is False:
print... | true | true |
f7fe0265d9ab1b2a5fbea6dd4235ff9c7fa6cbe2 | 217 | py | Python | webempresa/services/admin.py | JulioAlbertoTum/web-emp-django2 | f4ee48885f5f0166d3620c27569f7cbcaf997561 | [
"MIT"
] | null | null | null | webempresa/services/admin.py | JulioAlbertoTum/web-emp-django2 | f4ee48885f5f0166d3620c27569f7cbcaf997561 | [
"MIT"
] | 7 | 2020-06-05T22:07:06.000Z | 2022-03-11T23:54:48.000Z | webempresa/services/admin.py | JulioAlbertoTum/web-emp-django2 | f4ee48885f5f0166d3620c27569f7cbcaf997561 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Service
# Register your models here.
class ServiceAdmin(admin.ModelAdmin):
readonly_fields = ('created', 'updated')
admin.site.register(Service, ServiceAdmin) | 27.125 | 44 | 0.78341 | from django.contrib import admin
from .models import Service
class ServiceAdmin(admin.ModelAdmin):
readonly_fields = ('created', 'updated')
admin.site.register(Service, ServiceAdmin) | true | true |
f7fe03cb2684776bd3e75f9a0d36782abe353d52 | 2,716 | py | Python | rbw/utils/ffmpeg.py | CNCLgithub/rigid_body_world | e3bf8bf062d38a3fb00c8b9f36a866593769e9cb | [
"MIT"
] | null | null | null | rbw/utils/ffmpeg.py | CNCLgithub/rigid_body_world | e3bf8bf062d38a3fb00c8b9f36a866593769e9cb | [
"MIT"
] | null | null | null | rbw/utils/ffmpeg.py | CNCLgithub/rigid_body_world | e3bf8bf062d38a3fb00c8b9f36a866593769e9cb | [
"MIT"
] | 1 | 2021-10-02T18:09:51.000Z | 2021-10-02T18:09:51.000Z | import os
import shlex
import subprocess
from pprint import pprint
def continous(source, out, start, vframes, fps):
cmd = ('ffmpeg -y -start_number {0:d} -framerate {2:d} -i {1!s} -hide_banner -crf 5 '+ \
'-preset slow -c:v libx264 -pix_fmt yuv420p')
cmd = cmd.format(start, source, fps)
if not ... | 31.581395 | 93 | 0.554492 | import os
import shlex
import subprocess
from pprint import pprint
def continous(source, out, start, vframes, fps):
cmd = ('ffmpeg -y -start_number {0:d} -framerate {2:d} -i {1!s} -hide_banner -crf 5 '+ \
'-preset slow -c:v libx264 -pix_fmt yuv420p')
cmd = cmd.format(start, source, fps)
if not ... | true | true |
f7fe061ae5402f8739f69ff13a598a9c6934f9f7 | 375 | py | Python | Appointment/migrations/0004_auto_20210304_2051.py | CiganOliviu/InfiniteShoot | 14f7fb21e360e3c58876d82ebbe206054c72958e | [
"MIT"
] | 1 | 2021-04-02T16:45:37.000Z | 2021-04-02T16:45:37.000Z | Appointment/migrations/0004_auto_20210304_2051.py | CiganOliviu/InfiniteShoot-1 | 6322ae34f88caaffc1de29dfa4f6d86d175810a7 | [
"Apache-2.0"
] | null | null | null | Appointment/migrations/0004_auto_20210304_2051.py | CiganOliviu/InfiniteShoot-1 | 6322ae34f88caaffc1de29dfa4f6d86d175810a7 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-04 18:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Appointment', '0003_adminresponse'),
]
operations = [
migrations.RenameField(
model_name='appointment',
old_name='calendar',... | 19.736842 | 47 | 0.597333 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('Appointment', '0003_adminresponse'),
]
operations = [
migrations.RenameField(
model_name='appointment',
old_name='calendar',
new_name='desired_date',
)... | true | true |
f7fe09025329dea7a8f4983ed00b94e14ffabaa4 | 130 | py | Python | brute/__main__.py | noa/brute | 2c016c59b7748bd4b3a800488efdec8a45a33532 | [
"MIT"
] | 1 | 2018-11-29T22:42:04.000Z | 2018-11-29T22:42:04.000Z | brute/__main__.py | noa/brute | 2c016c59b7748bd4b3a800488efdec8a45a33532 | [
"MIT"
] | null | null | null | brute/__main__.py | noa/brute | 2c016c59b7748bd4b3a800488efdec8a45a33532 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""brute.__main__: executed when brute directory is called as script."""
from .brute import main
main()
| 18.571429 | 72 | 0.676923 |
from .brute import main
main()
| true | true |
f7fe09257557768a0c1b4fb3b1c5fea27a669b7f | 17,017 | py | Python | kuber/latest/node_v1.py | datalayer-externals/kuber | 4d577950ce7d1be2b882fbe66827dc3d7e67b350 | [
"MIT"
] | 1 | 2019-06-11T04:57:34.000Z | 2019-06-11T04:57:34.000Z | kuber/latest/node_v1.py | datalayer-externals/kuber | 4d577950ce7d1be2b882fbe66827dc3d7e67b350 | [
"MIT"
] | 1 | 2019-05-05T22:08:13.000Z | 2019-05-06T11:43:32.000Z | kuber/latest/node_v1.py | datalayer-externals/kuber | 4d577950ce7d1be2b882fbe66827dc3d7e67b350 | [
"MIT"
] | 2 | 2021-05-08T14:47:56.000Z | 2021-10-15T21:47:04.000Z | import typing # noqa: F401
from kubernetes import client # noqa: F401
from kuber import kube_api as _kube_api # noqa: F401
from kuber import definitions as _kuber_definitions # noqa: F401
from kuber import _types # noqa: F401
from kuber.latest.meta_v1 import ListMeta # noqa: F401
from kuber.latest.meta_v1 impor... | 32.725 | 86 | 0.59323 | import typing
from kubernetes import client
from kuber import kube_api as _kube_api
from kuber import definitions as _kuber_definitions
from kuber import _types
from kuber.latest.meta_v1 import ListMeta
from kuber.latest.meta_v1 import ObjectMeta
from kuber.latest.core_v1 import Toleration
class Ove... | true | true |
f7fe0a23919edf02171642d4dde95287f46708c0 | 91,404 | py | Python | src/transformers/trainer.py | silvershine157/transformers | e6ce636e02ec1cd3f9893af6ab1eec4f113025db | [
"Apache-2.0"
] | 1 | 2021-03-08T20:38:33.000Z | 2021-03-08T20:38:33.000Z | src/transformers/trainer.py | Iwontbecreative/transformers | fd01104435914dd65c34026dcec8be008c40ee60 | [
"Apache-2.0"
] | null | null | null | src/transformers/trainer.py | Iwontbecreative/transformers | fd01104435914dd65c34026dcec8be008c40ee60 | [
"Apache-2.0"
] | 1 | 2021-11-06T19:12:30.000Z | 2021-11-06T19:12:30.000Z | # coding=utf-8
# Copyright 2020-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 47.261634 | 190 | 0.641941 |
import collections
import gc
import inspect
import math
import os
import re
import shutil
import time
import warnings
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union
from .integrations import (
default_hp_search_backend,
get_report... | true | true |
f7fe0a9f0087348944231663b7374366e13bbd29 | 13,719 | py | Python | pyspotter/pyspotter.py | samapriya/pyspotter | d9400a3ed2d60a7c7facdb8cae76f532b675415d | [
"MIT"
] | 2 | 2021-12-27T12:55:34.000Z | 2022-02-13T13:54:18.000Z | pyspotter/pyspotter.py | samapriya/pyspotter | d9400a3ed2d60a7c7facdb8cae76f532b675415d | [
"MIT"
] | null | null | null | pyspotter/pyspotter.py | samapriya/pyspotter | d9400a3ed2d60a7c7facdb8cae76f532b675415d | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
__copyright__ = """
MIT License
Copyright (c) 2021 Samapriya Roy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without... | 32.586698 | 140 | 0.577885 |
__copyright__ = """
MIT License
Copyright (c) 2021 Samapriya Roy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, mod... | true | true |
f7fe0b03fd919a0f12cea97eadbe8bef68a9152d | 5,179 | py | Python | methods/gan/image_translator.py | MendelXu/ANN | f4eabeb27dbba5c9bdcf83d03776bffa34995666 | [
"Apache-2.0"
] | 308 | 2019-08-11T02:12:37.000Z | 2022-03-30T07:20:41.000Z | methods/gan/image_translator.py | pinglmlcv/ANN | f4eabeb27dbba5c9bdcf83d03776bffa34995666 | [
"Apache-2.0"
] | 19 | 2019-08-22T04:57:33.000Z | 2022-03-27T10:59:23.000Z | methods/gan/image_translator.py | pinglmlcv/ANN | f4eabeb27dbba5c9bdcf83d03776bffa34995666 | [
"Apache-2.0"
] | 64 | 2019-08-17T07:09:50.000Z | 2022-03-27T11:23:39.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Donny You (youansheng@gmail.com)
# Class Definition for GAN.
import time
import torch
from datasets.gan.data_loader import DataLoader
from methods.tools.runner_helper import RunnerHelper
from methods.tools.trainer import Trainer
from models.gan.model_manager imp... | 36.992857 | 106 | 0.592585 |
import time
import torch
from datasets.gan.data_loader import DataLoader
from methods.tools.runner_helper import RunnerHelper
from methods.tools.trainer import Trainer
from models.gan.model_manager import ModelManager
from utils.tools.average_meter import AverageMeter
from utils.tools.logger import Logger as Log... | true | true |
f7fe0b195c3d2f8089fb534e7264eaa1cf3c0fd3 | 69,204 | py | Python | intersight/model/iam_resource_limits_relationship.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/iam_resource_limits_relationship.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/iam_resource_limits_relationship.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 62.289829 | 1,678 | 0.658907 |
import re
import sys
from intersight.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
def la... | true | true |
f7fe0b7eb8236f1edff4d62040437bd3b9cf81d9 | 44 | py | Python | privugger/test/addition.py | itu-square/reident | a9f2a2cfb43ea0adeccbbed7ef119f5eae243bf5 | [
"Apache-2.0"
] | 2 | 2021-12-10T13:45:37.000Z | 2021-12-15T08:32:01.000Z | privugger/test/addition.py | itu-square/reident | a9f2a2cfb43ea0adeccbbed7ef119f5eae243bf5 | [
"Apache-2.0"
] | 39 | 2021-03-24T10:08:50.000Z | 2022-03-29T22:02:24.000Z | unit-test/addition.py | itu-square/privugger | 9b57605dbd1ed072feaedc17ca0cd688dbf2459a | [
"Apache-2.0"
] | null | null | null | def name(age, height):
return age+height | 22 | 22 | 0.704545 | def name(age, height):
return age+height | true | true |
f7fe0ba9f2f4cc700800ad27d22b0e0995d7ac32 | 604 | py | Python | python_practice/random_number.py | vishalvb/practice | 4c38f863408c91aa072bd20510f098043fecd043 | [
"MIT"
] | null | null | null | python_practice/random_number.py | vishalvb/practice | 4c38f863408c91aa072bd20510f098043fecd043 | [
"MIT"
] | null | null | null | python_practice/random_number.py | vishalvb/practice | 4c38f863408c91aa072bd20510f098043fecd043 | [
"MIT"
] | null | null | null | #random number generation
import random
value = random.random()
print('random value is ', value)
value = random.uniform(1,10)
print('using random.uniform', value)
value = random.randint(1,6)
print('using random.int', value)
my_list = ['hi', 'hello', 'how areyou', 'welcome']
print('using random.choice', random.cho... | 24.16 | 78 | 0.695364 |
import random
value = random.random()
print('random value is ', value)
value = random.uniform(1,10)
print('using random.uniform', value)
value = random.randint(1,6)
print('using random.int', value)
my_list = ['hi', 'hello', 'how areyou', 'welcome']
print('using random.choice', random.choice(my_list))
colors = [... | true | true |
f7fe0c7dd1384b5de481aeb6cbed455df73fa3c9 | 3,317 | py | Python | server/endpoints/point/monthly.py | meteostat/meteostat-server | fecb4acab34ce97121a7c9a16e3ca1b4ffb55b7a | [
"MIT"
] | 3 | 2021-04-11T03:28:45.000Z | 2022-02-03T19:55:56.000Z | server/endpoints/point/monthly.py | meteostat/meteostat-server | fecb4acab34ce97121a7c9a16e3ca1b4ffb55b7a | [
"MIT"
] | 1 | 2021-09-21T12:45:07.000Z | 2021-09-23T08:53:56.000Z | server/endpoints/point/monthly.py | meteostat/meteostat-server | fecb4acab34ce97121a7c9a16e3ca1b4ffb55b7a | [
"MIT"
] | null | null | null | """
Meteostat JSON API Server
The code is licensed under the MIT license.
"""
from datetime import datetime
import json
from flask import abort
from meteostat import Point, Monthly, units
from server import app, utils
"""
Meteostat configuration
"""
Point.radius = 120000
Monthly.threads = 4
Monthly.autoclean = Fals... | 25.128788 | 83 | 0.503166 |
from datetime import datetime
import json
from flask import abort
from meteostat import Point, Monthly, units
from server import app, utils
Point.radius = 120000
Monthly.threads = 4
Monthly.autoclean = False
parameters = [
('lat', float, None),
('lon', float, None),
('alt', int, None),
('start', st... | true | true |
f7fe0d11cf148f60bef28141d143ceef06d812d5 | 1,277 | py | Python | corehq/apps/cloudcare/tests/test_dbaccessors.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/cloudcare/tests/test_dbaccessors.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/cloudcare/tests/test_dbaccessors.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | from django.test import TestCase
from corehq.apps.app_manager.signals import app_post_save
from corehq.apps.app_manager.tests.app_factory import AppFactory
from corehq.apps.cloudcare.dbaccessors import get_application_access_for_domain
from corehq.apps.cloudcare.models import ApplicationAccess
from corehq.util.context... | 38.69697 | 79 | 0.689115 | from django.test import TestCase
from corehq.apps.app_manager.signals import app_post_save
from corehq.apps.app_manager.tests.app_factory import AppFactory
from corehq.apps.cloudcare.dbaccessors import get_application_access_for_domain
from corehq.apps.cloudcare.models import ApplicationAccess
from corehq.util.context... | true | true |
f7fe0d39d149cc56dd47b3fe842830d2925e98d8 | 13,567 | py | Python | numpy_mpi_numexpr/cfd_mpi_ne.py | JiahuaZhao/HPC-Python-CFD | 4fe4db053566603232bf16bdd06f8207cdadde0a | [
"MIT"
] | null | null | null | numpy_mpi_numexpr/cfd_mpi_ne.py | JiahuaZhao/HPC-Python-CFD | 4fe4db053566603232bf16bdd06f8207cdadde0a | [
"MIT"
] | null | null | null | numpy_mpi_numexpr/cfd_mpi_ne.py | JiahuaZhao/HPC-Python-CFD | 4fe4db053566603232bf16bdd06f8207cdadde0a | [
"MIT"
] | null | null | null |
#!/usr/bin/env python
#
# CFD Calculation with MPI4PY
# ===============
#
# Simulation of inviscid flow in a 2D box using the Jacobi algorithm.
#
# Python version - uses numpy and loops
#
# Alejandro Dinkelberg
#
import os
import sys
#import mkl
import time
import mpi4py.MPI as MPI
# Import numpy
import numpy as np
... | 31.477958 | 287 | 0.512051 |
import os
import sys
import time
import mpi4py.MPI as MPI
import numpy as np
import numexpr as ne
from copy import deepcopy
os.environ['NUMEXPR_MAX_THREADS'] = '128'
ne.set_num_threads(2)
| true | true |
f7fe0eea8b5f1048c07a7e1fe46e1c3a425d7750 | 599 | py | Python | xjson/plugins/plugin_yaml.py | mikegribov/filedjson | ee9f8408edcf8a72b8ed415237789a602ee6b579 | [
"MIT"
] | null | null | null | xjson/plugins/plugin_yaml.py | mikegribov/filedjson | ee9f8408edcf8a72b8ed415237789a602ee6b579 | [
"MIT"
] | null | null | null | xjson/plugins/plugin_yaml.py | mikegribov/filedjson | ee9f8408edcf8a72b8ed415237789a602ee6b579 | [
"MIT"
] | null | null | null |
from .base_file import BaseFilePlugin
from ..xnodes import create_xnode, XNode, XDict, XFileError
import yaml
class PluginYaml(BaseFilePlugin):
def def_extensions(self) -> set:
return {'yaml'}
def load(self, content) -> XNode:
if content.strip() == '':
result = XDic... | 27.227273 | 86 | 0.592654 |
from .base_file import BaseFilePlugin
from ..xnodes import create_xnode, XNode, XDict, XFileError
import yaml
class PluginYaml(BaseFilePlugin):
def def_extensions(self) -> set:
return {'yaml'}
def load(self, content) -> XNode:
if content.strip() == '':
result = XDic... | true | true |
f7fe0ff52b81c937de605d73a5c7587aa5e2b7d3 | 12,549 | py | Python | sublime/Packages/Minify/Minify.py | thrvrs/dotfiles | 362c74187b569b6c962392688b94f458a167722d | [
"MIT"
] | null | null | null | sublime/Packages/Minify/Minify.py | thrvrs/dotfiles | 362c74187b569b6c962392688b94f458a167722d | [
"MIT"
] | null | null | null | sublime/Packages/Minify/Minify.py | thrvrs/dotfiles | 362c74187b569b6c962392688b94f458a167722d | [
"MIT"
] | null | null | null | import sublime, sublime_plugin, re, os, subprocess, platform, ntpath, shlex
PLUGIN_DIR = os.getcwd() if int(sublime.version()) < 3000 else os.path.dirname(__file__)
SUBL_ASYNC = callable(getattr(sublime, 'set_timeout_async', None))
USE_SHELL = sublime.platform() == 'windows'
POPEN_ENV = ({'PATH': ':'.join(['/usr/local... | 47.534091 | 336 | 0.666587 | import sublime, sublime_plugin, re, os, subprocess, platform, ntpath, shlex
PLUGIN_DIR = os.getcwd() if int(sublime.version()) < 3000 else os.path.dirname(__file__)
SUBL_ASYNC = callable(getattr(sublime, 'set_timeout_async', None))
USE_SHELL = sublime.platform() == 'windows'
POPEN_ENV = ({'PATH': ':'.join(['/usr/local... | true | true |
f7fe10d850678e29dc62fae9992a5d8940eba91a | 2,046 | py | Python | examples/demo2.py | rmaiko/pyvsim | 18d51d8fc3678ffcb08fd0939dc72c1a8834327d | [
"Apache-2.0"
] | null | null | null | examples/demo2.py | rmaiko/pyvsim | 18d51d8fc3678ffcb08fd0939dc72c1a8834327d | [
"Apache-2.0"
] | null | null | null | examples/demo2.py | rmaiko/pyvsim | 18d51d8fc3678ffcb08fd0939dc72c1a8834327d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""
PyVSim part2.1
Copyright 2013 Ricardo Entz
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... | 32.47619 | 72 | 0.56696 |
if __name__ == '__main__':
import sys
sys.path.append("../")
import numpy as np
from pyvsim import *
vol = Primitives.Volume()
vol.points = np.array([[0 ,0,0],
[1 ,0,0],
[0.5 ,0.866,0],
[1e-6,0,0],
... | true | true |
f7fe120f3a4d41a00ea89f6c4175ee40b1ec2cfe | 1,346 | py | Python | files_to_dataframe/ftd/manipulators/collection.py | LilianBoulard/utils | 84acd0f24afc976a92aa422bfd8ec5c725800b98 | [
"MIT"
] | 2 | 2020-12-15T11:54:58.000Z | 2021-01-21T17:34:06.000Z | files_to_dataframe/ftd/manipulators/collection.py | Phaide/utils | 84acd0f24afc976a92aa422bfd8ec5c725800b98 | [
"MIT"
] | null | null | null | files_to_dataframe/ftd/manipulators/collection.py | Phaide/utils | 84acd0f24afc976a92aa422bfd8ec5c725800b98 | [
"MIT"
] | null | null | null | from .base import BaseManipulator
from . import ByUserManipulator, ByDateManipulator, ByExtensionManipulator, ByDirectoryManipulator, BySizeManipulator
class ManipulatorCollection:
"""
This class is used to instantiate all the manipulators
"""
def __init__(self, **kwargs):
# Forbid passing ... | 36.378378 | 117 | 0.673848 | from .base import BaseManipulator
from . import ByUserManipulator, ByDateManipulator, ByExtensionManipulator, ByDirectoryManipulator, BySizeManipulator
class ManipulatorCollection:
def __init__(self, **kwargs):
if 'parent' in kwargs.keys():
raise RuntimeError('Got unexpected argume... | true | true |
f7fe127a3088f5e9dfdd5f7eaf83eb9a34bf72e0 | 1,190 | py | Python | sts/routes.py | Cray-HPE/cray-sts | a731a54f58ccb4b57f829253e96afd0f75ca2a01 | [
"MIT"
] | null | null | null | sts/routes.py | Cray-HPE/cray-sts | a731a54f58ccb4b57f829253e96afd0f75ca2a01 | [
"MIT"
] | 2 | 2021-11-30T16:20:34.000Z | 2021-12-01T01:23:02.000Z | sts/routes.py | Cray-HPE/cray-sts | a731a54f58ccb4b57f829253e96afd0f75ca2a01 | [
"MIT"
] | null | null | null | # Copyright 2019, Cray Inc. All rights reserved.
""" These are the routes that are mapped to from connexion """
import uuid
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
from flask import current_app as app
from sts import client as c
def put_token():
""" PUT /token - Genera... | 29.75 | 92 | 0.670588 |
import uuid
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
from flask import current_app as app
from sts import client as c
def put_token():
try:
client = c.get_sts_client()
except Exception as e:
app.logger.error(e)
return "Error", 500
... | true | true |
f7fe144a6b1475ca33c443395eda241d9632d7db | 11,015 | py | Python | django/entity/models.py | cmu-lib/authority | 9b8d5f2f0b6b5ae50ca1de4f85fde5a3aa003167 | [
"MIT"
] | null | null | null | django/entity/models.py | cmu-lib/authority | 9b8d5f2f0b6b5ae50ca1de4f85fde5a3aa003167 | [
"MIT"
] | null | null | null | django/entity/models.py | cmu-lib/authority | 9b8d5f2f0b6b5ae50ca1de4f85fde5a3aa003167 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.postgres.fields import ArrayField
from authority import mixins, namespaces
from authority.models import CloseMatch, Authority
from rdflib import Graph, namespace
from rdflib.term import URIRef
from edtf import parse_edtf, struct_time_to_date
from collections import named... | 33.788344 | 103 | 0.57567 | from django.db import models
from django.contrib.postgres.fields import ArrayField
from authority import mixins, namespaces
from authority.models import CloseMatch, Authority
from rdflib import Graph, namespace
from rdflib.term import URIRef
from edtf import parse_edtf, struct_time_to_date
from collections import named... | true | true |
f7fe14afd267c81e5801235ae2a641efdc6ae22a | 1,508 | py | Python | IsStressful.py | Cynthyah/Exercises | 4c458cb518d8e77f2c51a9dd8d36eb4e4c73364c | [
"MIT"
] | null | null | null | IsStressful.py | Cynthyah/Exercises | 4c458cb518d8e77f2c51a9dd8d36eb4e4c73364c | [
"MIT"
] | null | null | null | IsStressful.py | Cynthyah/Exercises | 4c458cb518d8e77f2c51a9dd8d36eb4e4c73364c | [
"MIT"
] | null | null | null | # The function should recognise if a subject line is stressful.
# A stressful subject line means that all letters are in uppercase,
# and/or ends by at least 3 exclamation marks, and/or contains at least
# one of the following “red” words: "help", "asap", "urgent".
# Any of those "red" words can be spelled in differ... | 35.904762 | 95 | 0.617374 |
def is_stressful(subj):
if subj[-3:] == '!!!' or subj.isupper():
return True
word = ' '
for l in subj.lower():
if l.isalpha():
if word[-1] != l:
word += l
red_words = ['help','asap','urgent']
for red in red_words:
if ... | true | true |
f7fe14d138cf6f7fd1ab65ca5a26b92088033547 | 44 | py | Python | imgcrop/settings/__init__.py | shineklbm/django-image-upload-crop | d87e43e450f5b4bd5b87c2c1a456a4215c594a74 | [
"MIT"
] | null | null | null | imgcrop/settings/__init__.py | shineklbm/django-image-upload-crop | d87e43e450f5b4bd5b87c2c1a456a4215c594a74 | [
"MIT"
] | null | null | null | imgcrop/settings/__init__.py | shineklbm/django-image-upload-crop | d87e43e450f5b4bd5b87c2c1a456a4215c594a74 | [
"MIT"
] | null | null | null | from .default import *
from .local import *
| 14.666667 | 22 | 0.727273 | from .default import *
from .local import *
| true | true |
f7fe150adba20525340c4fb770952bf65cd76c07 | 1,182 | py | Python | examples/nameko_sqlalchemy/app.py | sww/graphene-sqlalchemy | 4016b624173207d6d302c8600b841aa1a2eaf87d | [
"MIT"
] | null | null | null | examples/nameko_sqlalchemy/app.py | sww/graphene-sqlalchemy | 4016b624173207d6d302c8600b841aa1a2eaf87d | [
"MIT"
] | null | null | null | examples/nameko_sqlalchemy/app.py | sww/graphene-sqlalchemy | 4016b624173207d6d302c8600b841aa1a2eaf87d | [
"MIT"
] | null | null | null | from database import db_session, init_db
from schema import schema
from graphql_server import (HttpQueryError, default_format_error,
encode_execution_results, json_encode,load_json_body, run_http_query)
class App():
def __init__(self):
init_db()
def query(self, request):
da... | 32.833333 | 97 | 0.661591 | from database import db_session, init_db
from schema import schema
from graphql_server import (HttpQueryError, default_format_error,
encode_execution_results, json_encode,load_json_body, run_http_query)
class App():
def __init__(self):
init_db()
def query(self, request):
da... | true | true |
f7fe162588d2c1b718581e23282cac2f0c645211 | 4,275 | py | Python | zcrmsdk/src/com/zoho/crm/api/util/datatype_converter.py | zoho/zohocrm-python-sdk-2.0 | 3a93eb3b57fed4e08f26bd5b311e101cb2995411 | [
"Apache-2.0"
] | null | null | null | zcrmsdk/src/com/zoho/crm/api/util/datatype_converter.py | zoho/zohocrm-python-sdk-2.0 | 3a93eb3b57fed4e08f26bd5b311e101cb2995411 | [
"Apache-2.0"
] | null | null | null | zcrmsdk/src/com/zoho/crm/api/util/datatype_converter.py | zoho/zohocrm-python-sdk-2.0 | 3a93eb3b57fed4e08f26bd5b311e101cb2995411 | [
"Apache-2.0"
] | null | null | null | try:
from dateutil.tz import tz
import dateutil.parser
from zcrmsdk.src.com.zoho.crm.api.util.constants import Constants
from datetime import date, datetime
except Exception:
from dateutil.tz import tz
import dateutil.parser
from .constants import Constants
from datetime import date, dat... | 37.173913 | 193 | 0.679766 | try:
from dateutil.tz import tz
import dateutil.parser
from zcrmsdk.src.com.zoho.crm.api.util.constants import Constants
from datetime import date, datetime
except Exception:
from dateutil.tz import tz
import dateutil.parser
from .constants import Constants
from datetime import date, dat... | true | true |
f7fe1667392be67c07c4a7b95524ad4da5f2b62c | 21,643 | py | Python | tests/test_errors.py | maltefritz/tespy | e7463cf71f69d091adc0eeb985d5ac549ae170a8 | [
"MIT"
] | 1 | 2022-03-23T10:25:36.000Z | 2022-03-23T10:25:36.000Z | tests/test_errors.py | nkawerau/tespy | 26865e3d530b972c59fe0af47d6561843bcdd4d6 | [
"MIT"
] | null | null | null | tests/test_errors.py | nkawerau/tespy | 26865e3d530b972c59fe0af47d6561843bcdd4d6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8
"""Module for testing program errors.
This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted
by the contributors recorded in the version control history of the file,
available from its original location
tests/test_errors.py
SPDX-License-Identifier: MIT
"""
import os
import ... | 32.742814 | 78 | 0.618537 |
import os
import shutil
from pytest import raises
from tespy.components import CombustionChamber
from tespy.components import CombustionEngine
from tespy.components import Compressor
from tespy.components import Merge
from tespy.components import Pipe
from tespy.components import Sink
from tespy.components import S... | true | true |
f7fe16fd1ca24a2a6bf431dc7ddc6550afffd1e4 | 4,425 | py | Python | tests/integration/widgets/test_toggle.py | daledali/bokeh | c4f0debe7bd230d7e1aa8500716e8e997c04f528 | [
"BSD-3-Clause"
] | 1 | 2020-01-19T03:17:18.000Z | 2020-01-19T03:17:18.000Z | tests/integration/widgets/test_toggle.py | daledali/bokeh | c4f0debe7bd230d7e1aa8500716e8e997c04f528 | [
"BSD-3-Clause"
] | 1 | 2021-05-12T10:14:45.000Z | 2021-05-12T10:14:45.000Z | tests/integration/widgets/test_toggle.py | daledali/bokeh | c4f0debe7bd230d7e1aa8500716e8e997c04f528 | [
"BSD-3-Clause"
] | 1 | 2020-01-21T12:03:58.000Z | 2020-01-21T12:03:58.000Z | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | 33.270677 | 116 | 0.541921 |
import pytest ; pytest
from bokeh._testing.util.selenium import RECORD
from bokeh.core.enums import ButtonType
from bokeh.layouts import column
from bokeh.models import (
Circle,
ColumnDataSource,
CustomAction,
CustomJS,
Plot,
Range1d,
Toggle,
)
pytest_plugins = (
"... | true | true |
f7fe1743ea73f309aebae27d9620407ab48702ec | 173 | py | Python | shiyanlou_cs354-127b99c086/minecloud/virtualmachine/constants.py | tongxindao/shiyanlou | 1d002ea342deb69066c287db9935f77f49f0a09e | [
"Apache-2.0"
] | null | null | null | shiyanlou_cs354-127b99c086/minecloud/virtualmachine/constants.py | tongxindao/shiyanlou | 1d002ea342deb69066c287db9935f77f49f0a09e | [
"Apache-2.0"
] | null | null | null | shiyanlou_cs354-127b99c086/minecloud/virtualmachine/constants.py | tongxindao/shiyanlou | 1d002ea342deb69066c287db9935f77f49f0a09e | [
"Apache-2.0"
] | null | null | null | # _*_ coding: utf-8 _*_
# VM status
VM_RUNNING = 5
VM_SHUTDOWN = 1
VM_INIT = 0
VM_STATUS = {
VM_RUNNING: 'RUNNING',
VM_SHUTDOWN: 'SHUTDOWN',
VM_INIT: 'INIT'
}
| 13.307692 | 28 | 0.630058 |
VM_RUNNING = 5
VM_SHUTDOWN = 1
VM_INIT = 0
VM_STATUS = {
VM_RUNNING: 'RUNNING',
VM_SHUTDOWN: 'SHUTDOWN',
VM_INIT: 'INIT'
}
| true | true |
f7fe17fae6c1cfe317f6a98617410bb1fb9db586 | 722 | py | Python | BOJ/02000~02999/2100~2199/2143.py | shinkeonkim/today-ps | f3e5e38c5215f19579bb0422f303a9c18c626afa | [
"Apache-2.0"
] | 2 | 2020-01-29T06:54:41.000Z | 2021-11-07T13:23:27.000Z | BOJ/02000~02999/2100~2199/2143.py | shinkeonkim/Today_PS | bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44 | [
"Apache-2.0"
] | null | null | null | BOJ/02000~02999/2100~2199/2143.py | shinkeonkim/Today_PS | bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44 | [
"Apache-2.0"
] | null | null | null | T = int(input())
N = int(input())
L1 = list(map(int,input().split()))
M = int(input())
L2 = list(map(int,input().split()))
d1 = dict()
d2 = dict()
D1 = [0,L1[0]]
D2 = [0,L2[0]]
for i in range(1,N):
D1.append(D1[-1]+L1[i])
for i in range(1,M):
D2.append(D2[-1]+L2[i])
for i in range(N+1):
for j in range(i... | 18.512821 | 50 | 0.469529 | T = int(input())
N = int(input())
L1 = list(map(int,input().split()))
M = int(input())
L2 = list(map(int,input().split()))
d1 = dict()
d2 = dict()
D1 = [0,L1[0]]
D2 = [0,L2[0]]
for i in range(1,N):
D1.append(D1[-1]+L1[i])
for i in range(1,M):
D2.append(D2[-1]+L2[i])
for i in range(N+1):
for j in range(i... | true | true |
f7fe1835534bf2c815a3365cf3833fb15b5aa8c1 | 77,800 | py | Python | lib/endpoints-1.0/endpoints/api_config.py | enpi/Test | 5fb2055c7cfd4cc91ff97471c529b041f21abeb6 | [
"Apache-2.0"
] | null | null | null | lib/endpoints-1.0/endpoints/api_config.py | enpi/Test | 5fb2055c7cfd4cc91ff97471c529b041f21abeb6 | [
"Apache-2.0"
] | null | null | null | lib/endpoints-1.0/endpoints/api_config.py | enpi/Test | 5fb2055c7cfd4cc91ff97471c529b041f21abeb6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 35.331517 | 80 | 0.695488 |
try:
import json
except ImportError:
import simplejson as json
import logging
import re
from endpoints import message_parser
from endpoints import users_id_token
from protorpc import message_types
from protorpc import messages
from protorpc import remote
from protorpc import util
t... | true | true |
f7fe186cf8b35974e72fed6ab6a45a191b898763 | 6,549 | py | Python | tensorflow/compiler/tests/xla_test.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 28 | 2017-04-08T09:47:57.000Z | 2020-07-12T03:10:46.000Z | tensorflow/compiler/tests/xla_test.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 7 | 2017-07-13T09:40:59.000Z | 2019-04-08T22:46:51.000Z | tensorflow/compiler/tests/xla_test.py | AlexChrisF/udacity | b7f85a74058fc63ccb7601c418450ab934ef5953 | [
"Apache-2.0"
] | 38 | 2017-04-28T04:15:48.000Z | 2019-09-28T05:11:46.000Z | # 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... | 38.523529 | 80 | 0.706825 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import random
import re
import numpy as np
from tensorflow.contrib.compiler import jit
from tensorflow.core.framework import types_pb2
from tensorflow.core.protobuf import con... | true | true |
f7fe188ff2e3f3c000edbdaaa53dda2021532221 | 7,810 | py | Python | Parameter_inference_real_data/figures/plot-complex-ap-supplement-compare.py | CardiacModelling/model-reduction-manifold-boundaries | 88ccb24d0ec9d0742a4a93e820fec7fee1a65b61 | [
"BSD-3-Clause"
] | null | null | null | Parameter_inference_real_data/figures/plot-complex-ap-supplement-compare.py | CardiacModelling/model-reduction-manifold-boundaries | 88ccb24d0ec9d0742a4a93e820fec7fee1a65b61 | [
"BSD-3-Clause"
] | null | null | null | Parameter_inference_real_data/figures/plot-complex-ap-supplement-compare.py | CardiacModelling/model-reduction-manifold-boundaries | 88ccb24d0ec9d0742a4a93e820fec7fee1a65b61 | [
"BSD-3-Clause"
] | null | null | null | import myokit
import myokit.pacing as pacing
import numpy as np
import matplotlib
import matplotlib.pyplot as pl
import myokit.lib.markov as markov
import pints
import argparse
import os
import sys
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes, inset_axes
from mpl_toolkits.axes_grid1.inset_locato... | 32.953586 | 152 | 0.618822 | import myokit
import myokit.pacing as pacing
import numpy as np
import matplotlib
import matplotlib.pyplot as pl
import myokit.lib.markov as markov
import pints
import argparse
import os
import sys
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes, inset_axes
from mpl_toolkits.axes_grid1.inset_locato... | true | true |
f7fe190a60165982d955b3a5e671735acdf83472 | 4,858 | py | Python | usage.py | preftech/dash-tabulator | 207ae1ff6f683471cb0a02247ddff32860400210 | [
"MIT"
] | 62 | 2020-07-10T00:40:21.000Z | 2022-03-10T00:11:35.000Z | usage.py | preftech/dash-tabulator | 207ae1ff6f683471cb0a02247ddff32860400210 | [
"MIT"
] | 50 | 2020-07-15T14:27:33.000Z | 2022-02-20T14:08:09.000Z | usage.py | preftech/dash-tabulator | 207ae1ff6f683471cb0a02247ddff32860400210 | [
"MIT"
] | 16 | 2020-07-13T03:02:24.000Z | 2022-02-22T02:22:02.000Z | import dash_tabulator
import dash
from dash.dependencies import Input, Output
import dash_html_components as html
import dash_core_components as dcc
from dash_extensions.javascript import Namespace
#from textwrap import dedent as d
#import json
external_scripts = ['https://oss.sheetjs.com/sheetjs/xlsx.full.min.js']
e... | 47.627451 | 125 | 0.584397 | import dash_tabulator
import dash
from dash.dependencies import Input, Output
import dash_html_components as html
import dash_core_components as dcc
from dash_extensions.javascript import Namespace
external_scripts = ['https://oss.sheetjs.com/sheetjs/xlsx.full.min.js']
external_stylesheets = ['https://stackpath.boo... | true | true |
f7fe196ff93759113abd6befa98b15fe6d4d2c9d | 485 | py | Python | pymterm/term_pyglet/window.py | stonewell/pymterm | af36656d5f7fb008533178d14b00d83d72ba00cf | [
"MIT"
] | 102 | 2016-07-21T06:39:02.000Z | 2022-03-09T19:34:03.000Z | pymterm/term_pyglet/window.py | stonewell/pymterm | af36656d5f7fb008533178d14b00d83d72ba00cf | [
"MIT"
] | 2 | 2017-01-11T13:43:34.000Z | 2020-01-19T12:06:47.000Z | pymterm/term_pyglet/window.py | stonewell/pymterm | af36656d5f7fb008533178d14b00d83d72ba00cf | [
"MIT"
] | 4 | 2020-03-22T04:08:35.000Z | 2021-06-27T23:38:02.000Z | # coding=utf-8
import logging
import sys
from functools32 import lru_cache
import cap.cap_manager
from session import create_session
from term import TextAttribute, TextMode, reserve
import term.term_keyboard
from term.terminal_gui import TerminalGUI
from term.terminal_widget import TerminalWidget
import window_base
... | 25.526316 | 63 | 0.814433 |
import logging
import sys
from functools32 import lru_cache
import cap.cap_manager
from session import create_session
from term import TextAttribute, TextMode, reserve
import term.term_keyboard
from term.terminal_gui import TerminalGUI
from term.terminal_widget import TerminalWidget
import window_base
class TermPy... | true | true |
f7fe1a75fe592ba214223dd1f0a925acfe826468 | 5,911 | py | Python | upload_tool/pgy_upload_android.py | FRA7/pgy_upload_tool | 676ed92f2030643dd91f4495f423885e300100c6 | [
"MIT"
] | null | null | null | upload_tool/pgy_upload_android.py | FRA7/pgy_upload_tool | 676ed92f2030643dd91f4495f423885e300100c6 | [
"MIT"
] | null | null | null | upload_tool/pgy_upload_android.py | FRA7/pgy_upload_tool | 676ed92f2030643dd91f4495f423885e300100c6 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
* User: fraj
* Email: fraj@foxmail.com
* Date: 18/2/1
* Time: 10:00
"""
import time
import urllib2
import time
import json
import mimetypes
import os
import smtplib
from email.mime.base import MIMEBase
from email.MIMEText import MIMEText
from email.MIMEMultipart import ... | 28.555556 | 121 | 0.632888 |
"""
* User: fraj
* Email: fraj@foxmail.com
* Date: 18/2/1
* Time: 10:00
"""
import time
import urllib2
import time
import json
import mimetypes
import os
import smtplib
from email.mime.base import MIMEBase
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
... | false | true |
f7fe1b7ad6706920ab8b0a28dcc9748b3a7091f9 | 6,359 | py | Python | pysnmp/JUNIPER-LSYSSP-NATPOIPNUM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/JUNIPER-LSYSSP-NATPOIPNUM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/JUNIPER-LSYSSP-NATPOIPNUM-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 JUNIPER-LSYSSP-NATPOIPNUM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/JUNIPER-LSYSSP-NATPOIPNUM-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:49:05 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python ve... | 129.77551 | 1,093 | 0.788331 |
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint = mibBuild... | true | true |
f7fe1bcd6fa84e313ad83eafb8b085f27e7b902a | 391 | py | Python | Summarisation/main_app.py | FreeBirdsCrew/MachineLearning_Scratch | 3b7d877952352017d2879dfc309ac6730096233b | [
"MIT"
] | 1 | 2020-12-11T10:27:16.000Z | 2020-12-11T10:27:16.000Z | Summarisation/main_app.py | FreeBirdsCrew/MachineLearning_Scratch | 3b7d877952352017d2879dfc309ac6730096233b | [
"MIT"
] | null | null | null | Summarisation/main_app.py | FreeBirdsCrew/MachineLearning_Scratch | 3b7d877952352017d2879dfc309ac6730096233b | [
"MIT"
] | null | null | null | from flask import Flask # import flask
app = Flask(__name__) # create an app instance
@app.route("/") # at the end point /
def hello(): # call method hello
return "Hello World!" # which returns "hello world"
if __name__ == "__main__": ... | 48.875 | 64 | 0.514066 | from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run() | true | true |
f7fe1c3bfd47e0be5b8a22d3eee24b8e2eaf93ba | 11,399 | py | Python | tests/loggers/test_tensorboard.py | xxxhycl2010/pytorch-lightning | 7e18b118449133a5184b9014082ff1fb9818cf9b | [
"Apache-2.0"
] | 2 | 2021-08-24T17:46:10.000Z | 2022-02-19T14:39:29.000Z | tests/loggers/test_tensorboard.py | xxxhycl2010/pytorch-lightning | 7e18b118449133a5184b9014082ff1fb9818cf9b | [
"Apache-2.0"
] | 2 | 2021-07-03T07:07:32.000Z | 2022-03-10T16:07:20.000Z | tests/loggers/test_tensorboard.py | xxxhycl2010/pytorch-lightning | 7e18b118449133a5184b9014082ff1fb9818cf9b | [
"Apache-2.0"
] | 1 | 2021-11-29T11:18:52.000Z | 2021-11-29T11:18:52.000Z | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 33.233236 | 114 | 0.674708 |
import os
from argparse import Namespace
from unittest import mock
import pytest
import torch
import yaml
from omegaconf import OmegaConf
from packaging.version import Version
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
from pytorch_lightning import Trainer
from py... | true | true |
f7fe1d2379e184cf78cde96798fc34d8b40fe50e | 2,839 | py | Python | lib/stagers/osx/macho.py | Gui-Luz/Empire | 6f5eeff5f46dd085e1317cb09b39853a2fce5d13 | [
"BSD-3-Clause"
] | 5,720 | 2017-02-02T13:59:40.000Z | 2022-03-31T09:50:10.000Z | lib/stagers/osx/macho.py | VookiBoo/Empire | 5aae31e7de591282773d2c8498af04ee4e8778f5 | [
"BSD-3-Clause"
] | 866 | 2017-02-02T10:56:31.000Z | 2020-01-17T07:47:05.000Z | lib/stagers/osx/macho.py | VookiBoo/Empire | 5aae31e7de591282773d2c8498af04ee4e8778f5 | [
"BSD-3-Clause"
] | 2,181 | 2017-02-04T10:28:41.000Z | 2022-03-31T04:36:56.000Z | from lib.common import helpers
class Stager:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'macho',
'Author': ['@xorrior'],
'Description': ('Generates a macho executable.'),
'Comments': [
''
]
}
... | 34.204819 | 151 | 0.495245 | from lib.common import helpers
class Stager:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'macho',
'Author': ['@xorrior'],
'Description': ('Generates a macho executable.'),
'Comments': [
''
]
}
... | false | true |
f7fe1d9d3eaf3358e979f16c4e47e42c1529c075 | 499 | py | Python | src/xraysink/util.py | garyd203/xray-asyncio | 6fe8a4de74372a5a914f52fcbfb9b9a390ed290a | [
"Apache-2.0"
] | null | null | null | src/xraysink/util.py | garyd203/xray-asyncio | 6fe8a4de74372a5a914f52fcbfb9b9a390ed290a | [
"Apache-2.0"
] | null | null | null | src/xraysink/util.py | garyd203/xray-asyncio | 6fe8a4de74372a5a914f52fcbfb9b9a390ed290a | [
"Apache-2.0"
] | null | null | null | """Miscellaneous functions for working with the X-Ray SDK."""
from aws_xray_sdk.core import xray_recorder
# noinspection PyProtectedMember
def has_current_trace() -> bool:
"""Whether there is currently a trace.
This is like calling xray_recorder.get_trace_entity(), but without the
annoying error handlin... | 33.266667 | 94 | 0.761523 |
from aws_xray_sdk.core import xray_recorder
def has_current_trace() -> bool:
return bool(getattr(xray_recorder.context._local, "entities", None))
| true | true |
f7fe1dcec75f9f7dc8cc780592c815cd8bef9bd4 | 1,943 | py | Python | superflore/parser.py | zelenkovsky/superflore | 78e62c3b227da6d75bf361e70200ee72cb6de8b0 | [
"Apache-2.0"
] | null | null | null | superflore/parser.py | zelenkovsky/superflore | 78e62c3b227da6d75bf361e70200ee72cb6de8b0 | [
"Apache-2.0"
] | null | null | null | superflore/parser.py | zelenkovsky/superflore | 78e62c3b227da6d75bf361e70200ee72cb6de8b0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 30.84127 | 74 | 0.587751 |
import argparse
def get_parser(tool_tip, is_generator=True):
parser = argparse.ArgumentParser(tool_tip)
if is_generator:
parser.add_argument(
'--ros-distro',
help='regenerate packages for the specified distro',
type=str
)
parser.add_ar... | true | true |
f7fe1fc07e0057997ed4e3cc163e88c1a5654472 | 287 | py | Python | automatic-hardware-analysis/src/com/automatic/hardware/analysis/__init__.py | jvruas/simple-get-data-about-computer-hardware | c1a45b0548391a964f7ab5ed7bb1c60686880640 | [
"MIT"
] | null | null | null | automatic-hardware-analysis/src/com/automatic/hardware/analysis/__init__.py | jvruas/simple-get-data-about-computer-hardware | c1a45b0548391a964f7ab5ed7bb1c60686880640 | [
"MIT"
] | null | null | null | automatic-hardware-analysis/src/com/automatic/hardware/analysis/__init__.py | jvruas/simple-get-data-about-computer-hardware | c1a45b0548391a964f7ab5ed7bb1c60686880640 | [
"MIT"
] | null | null | null | from SendComputerAnalysis import SendComputerAnalysis
class MainAutomaticHardwareAnalysis:
def __init__(self):
currentComputerAnalysis = SendComputerAnalysis()
# Definindo o arquivo como o Launcher do Projeto
if __name__ == "__main__":
MainAutomaticHardwareAnalysis()
| 26.090909 | 56 | 0.794425 | from SendComputerAnalysis import SendComputerAnalysis
class MainAutomaticHardwareAnalysis:
def __init__(self):
currentComputerAnalysis = SendComputerAnalysis()
if __name__ == "__main__":
MainAutomaticHardwareAnalysis()
| true | true |
f7fe1fd91aad6330980fa240cde4e9b972ba5956 | 2,751 | py | Python | model/models.py | Jokerakos/ekpa-papadimitriou | fe008b1fc963de4acddd5391a3bb4962bb706c97 | [
"MIT"
] | null | null | null | model/models.py | Jokerakos/ekpa-papadimitriou | fe008b1fc963de4acddd5391a3bb4962bb706c97 | [
"MIT"
] | null | null | null | model/models.py | Jokerakos/ekpa-papadimitriou | fe008b1fc963de4acddd5391a3bb4962bb706c97 | [
"MIT"
] | 1 | 2021-01-20T15:47:41.000Z | 2021-01-20T15:47:41.000Z | import psycopg2
import pandas as pd
def connect_to_db():
db_connection = psycopg2.connect(
host="***.***.***.**",
database="********",
user="*********",
password="********")
db_connection.set_session(autocommit=True)
cursor = db_connection.cursor()
cursor.execute('SELECT version()')
db_versi... | 31.261364 | 149 | 0.580516 | import psycopg2
import pandas as pd
def connect_to_db():
db_connection = psycopg2.connect(
host="***.***.***.**",
database="********",
user="*********",
password="********")
db_connection.set_session(autocommit=True)
cursor = db_connection.cursor()
cursor.execute('SELECT version()')
db_versi... | true | true |
f7fe1feceeccbb3c7dc6860f0ee5d6a9c10a57df | 7,507 | py | Python | PythonAndroid/youtube-dl/lib/python3.5/youtube_dl/extractor/rutv.py | jianglei12138/python-3.5.1 | 2d248ceba8aa4c14ee43e57ece99cc1a43fd22b7 | [
"PSF-2.0"
] | 5 | 2016-04-25T16:26:07.000Z | 2021-04-28T16:10:29.000Z | PythonAndroid/youtube-dl/lib/python3.5/youtube_dl/extractor/rutv.py | jianglei12138/python-3.5.1 | 2d248ceba8aa4c14ee43e57ece99cc1a43fd22b7 | [
"PSF-2.0"
] | 5 | 2016-04-22T01:33:31.000Z | 2016-08-04T15:33:19.000Z | PythonAndroid/youtube-dl/lib/python3.5/youtube_dl/extractor/rutv.py | jianglei12138/python-3.5.1 | 2d248ceba8aa4c14ee43e57ece99cc1a43fd22b7 | [
"PSF-2.0"
] | 4 | 2016-04-26T15:27:38.000Z | 2018-11-12T21:04:54.000Z | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none
)
class RUTVIE(InfoExtractor):
IE_DESC = 'RUTV.RU'
_VALID_URL = r'''(?x)
https?://player\.(?:rutv\.ru|vgtrk\.com)/
(?P<path>flas... | 36.79902 | 190 | 0.480085 |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none
)
class RUTVIE(InfoExtractor):
IE_DESC = 'RUTV.RU'
_VALID_URL = r'''(?x)
https?://player\.(?:rutv\.ru|vgtrk\.com)/
(?P<path>flash2v/container\.sw... | true | true |
f7fe1ff721e81c240a1ff55702a9dc5dede65fc8 | 1,199 | py | Python | max-cut/code/simulated_annealing.py | minasora/- | 7c496feba6b74d4743e6d9f8e3adbdd4f6dd48d5 | [
"MIT"
] | 1 | 2021-06-01T06:32:09.000Z | 2021-06-01T06:32:09.000Z | max-cut/code/simulated_annealing.py | minasora/- | 7c496feba6b74d4743e6d9f8e3adbdd4f6dd48d5 | [
"MIT"
] | null | null | null | max-cut/code/simulated_annealing.py | minasora/- | 7c496feba6b74d4743e6d9f8e3adbdd4f6dd48d5 | [
"MIT"
] | 3 | 2020-06-07T16:20:45.000Z | 2021-06-01T06:32:11.000Z | import local_search as ls
import record_process as rp
import max_cut_instance as m_instance
import random as rd
import math
T = 10000 # 温度
T_min = pow(10,-5) # 冷却温度
Max_iters = 10000 # 最大迭代次数
r = 0.99 # 降火
def E_evaluation(delta, T):
"""
返回多大可能接受新解
:param obj:
:param new_obj:
:return: 概率
... | 21.8 | 88 | 0.582152 | import local_search as ls
import record_process as rp
import max_cut_instance as m_instance
import random as rd
import math
T = 10000
T_min = pow(10,-5)
Max_iters = 10000
r = 0.99
def E_evaluation(delta, T):
if delta > 0:
return 1
else:
return math.exp(delta / T)
def simulated_anneal... | true | true |
f7fe216bdb9175bdf57112572f50a1c58ad54aff | 11,347 | py | Python | bot/constants.py | CasualCoder99/sir-lancebot | 0a6a355419d9382b35ac651117287d907e98af0c | [
"MIT"
] | null | null | null | bot/constants.py | CasualCoder99/sir-lancebot | 0a6a355419d9382b35ac651117287d907e98af0c | [
"MIT"
] | null | null | null | bot/constants.py | CasualCoder99/sir-lancebot | 0a6a355419d9382b35ac651117287d907e98af0c | [
"MIT"
] | null | null | null | import dataclasses
import enum
import logging
from datetime import datetime
from os import environ
from typing import Dict, NamedTuple
__all__ = (
"AdventOfCode",
"Branding",
"Cats",
"Channels",
"Categories",
"Client",
"Colours",
"Emojis",
"Icons",
"Lovefest",
"Month",
"... | 28.799492 | 111 | 0.67216 | import dataclasses
import enum
import logging
from datetime import datetime
from os import environ
from typing import Dict, NamedTuple
__all__ = (
"AdventOfCode",
"Branding",
"Cats",
"Channels",
"Categories",
"Client",
"Colours",
"Emojis",
"Icons",
"Lovefest",
"Month",
"... | true | true |
f7fe21e0482fd7a77646c12d7c6b49b43588b691 | 21,732 | py | Python | tests/test_modeling_gpt2.py | katarinaslama/transformers-1 | a5a8eeb772b185b0746f3ce9be6ae43181d2ca71 | [
"Apache-2.0"
] | 12 | 2021-06-05T03:51:23.000Z | 2022-03-05T05:09:41.000Z | tests/test_modeling_gpt2.py | katarinaslama/transformers-1 | a5a8eeb772b185b0746f3ce9be6ae43181d2ca71 | [
"Apache-2.0"
] | 1 | 2021-10-20T02:25:36.000Z | 2021-10-20T02:25:36.000Z | tests/test_modeling_gpt2.py | katarinaslama/transformers-1 | a5a8eeb772b185b0746f3ce9be6ae43181d2ca71 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 40.022099 | 118 | 0.675594 |
import unittest
from transformers import is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device
from .test_configuration_common import ConfigTester
from .test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask
if is_torch_av... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.