hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c4181a23401c75c1fd869a4dcc6e5a4b784b918 | 2,170 | py | Python | test/actions-multiple/gyptest-all.py | uilianries/gyp | d995c5b0906571e0037869e3c9b008f344e8ca92 | [
"BSD-3-Clause"
] | null | null | null | test/actions-multiple/gyptest-all.py | uilianries/gyp | d995c5b0906571e0037869e3c9b008f344e8ca92 | [
"BSD-3-Clause"
] | null | null | null | test/actions-multiple/gyptest-all.py | uilianries/gyp | d995c5b0906571e0037869e3c9b008f344e8ca92 | [
"BSD-3-Clause"
] | 3 | 2018-11-20T12:04:16.000Z | 2019-07-01T02:52:04.000Z | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies two actions can be attached to the same input files.
"""
import sys
import TestGyp
test = TestGyp.TestGyp()
if test.format ... | 28.552632 | 77 | 0.689401 |
import sys
import TestGyp
test = TestGyp.TestGyp()
if test.format == 'xcode-ninja':
test.skip(bug=527)
test.run_gyp('actions.gyp', chdir='src')
test.relocate('src', 'relocate/src')
if test.format in ['make', 'ninja']:
if test.format == 'make':
target = 'multi2.txt'
elif test.format == 'ninja':
... | true | true |
1c4181d2be11ed270ed6292731e8d25169755c2d | 42,380 | py | Python | tests/test_regressions.py | takizuka/drf-spectacular | 208429b7ace8c37a79e5e51bd8532dfaa8e0c853 | [
"BSD-3-Clause"
] | null | null | null | tests/test_regressions.py | takizuka/drf-spectacular | 208429b7ace8c37a79e5e51bd8532dfaa8e0c853 | [
"BSD-3-Clause"
] | null | null | null | tests/test_regressions.py | takizuka/drf-spectacular | 208429b7ace8c37a79e5e51bd8532dfaa8e0c853 | [
"BSD-3-Clause"
] | null | null | null | import uuid
from unittest import mock
import pytest
from django.core import validators
from django.db import models
from django.db.models import fields
from django.urls import path, re_path
from rest_framework import (
filters, generics, mixins, pagination, parsers, routers, serializers, views, viewsets,
)
from re... | 36.724437 | 143 | 0.674445 | import uuid
from unittest import mock
import pytest
from django.core import validators
from django.db import models
from django.db.models import fields
from django.urls import path, re_path
from rest_framework import (
filters, generics, mixins, pagination, parsers, routers, serializers, views, viewsets,
)
from re... | true | true |
1c41823bc3beaf18ca16772937ec5ad26af8e9c7 | 4,019 | py | Python | examples/seismic/poroelastic/poroelastic_example.py | rwalkerlewis/devito | 262364e5f2855ad01a281d517d400704b7667420 | [
"MIT"
] | null | null | null | examples/seismic/poroelastic/poroelastic_example.py | rwalkerlewis/devito | 262364e5f2855ad01a281d517d400704b7667420 | [
"MIT"
] | null | null | null | examples/seismic/poroelastic/poroelastic_example.py | rwalkerlewis/devito | 262364e5f2855ad01a281d517d400704b7667420 | [
"MIT"
] | null | null | null | import numpy as np
from argparse import ArgumentParser
from devito.logger import info
from examples.seismic.poroelastic import PoroelasticWaveSolver, demo_model
from examples.seismic import AcquisitionGeometry
def poroelastic_setup(shape=(50, 50), spacing=(15.0, 15.0), tn=500., num=200, space_order=4, nbpml=10,
... | 44.655556 | 102 | 0.623289 | import numpy as np
from argparse import ArgumentParser
from devito.logger import info
from examples.seismic.poroelastic import PoroelasticWaveSolver, demo_model
from examples.seismic import AcquisitionGeometry
def poroelastic_setup(shape=(50, 50), spacing=(15.0, 15.0), tn=500., num=200, space_order=4, nbpml=10,
... | true | true |
1c418584edcca91d53edc9629e0784c93c3b3636 | 2,550 | py | Python | sprites/vertex.py | lmason98/PyGraph | 22d734cfd97333578c91ba4e331716df0aec668e | [
"MIT"
] | null | null | null | sprites/vertex.py | lmason98/PyGraph | 22d734cfd97333578c91ba4e331716df0aec668e | [
"MIT"
] | null | null | null | sprites/vertex.py | lmason98/PyGraph | 22d734cfd97333578c91ba4e331716df0aec668e | [
"MIT"
] | null | null | null | """
File: sprites/vertex.py
Author: Luke Mason
Description: A graph vertex pygame sprite
"""
from settings import COLOR
from pygame.sprite import Sprite
from pygame import Surface, draw
TEXT = COLOR.get('white')
class Vertex(Sprite):
def __init__(self, x: int, y: int, color: (int, int, int) = TEXT, radius: int = ... | 25.247525 | 107 | 0.666275 | from settings import COLOR
from pygame.sprite import Sprite
from pygame import Surface, draw
TEXT = COLOR.get('white')
class Vertex(Sprite):
def __init__(self, x: int, y: int, color: (int, int, int) = TEXT, radius: int = 10) -> None:
Sprite.__init__(self)
self.drag = False self.selected = False
self.colo... | true | true |
1c41858c96b1c576aa3a7fdf95abe38872adc09e | 5,381 | py | Python | scons/scons-local-2.5.0/SCons/Tool/gdc.py | emamanto/Soar | 72d2bc095068dd87ac78dad4f48938f6edc0353a | [
"BSD-2-Clause"
] | 72 | 2020-06-12T06:33:41.000Z | 2021-03-22T03:15:56.000Z | scons/scons-local-2.5.0/SCons/Tool/gdc.py | emamanto/Soar | 72d2bc095068dd87ac78dad4f48938f6edc0353a | [
"BSD-2-Clause"
] | 9 | 2020-07-02T09:36:49.000Z | 2021-03-25T23:54:00.000Z | scons/scons-local-2.5.0/SCons/Tool/gdc.py | emamanto/Soar | 72d2bc095068dd87ac78dad4f48938f6edc0353a | [
"BSD-2-Clause"
] | 14 | 2020-06-12T03:08:03.000Z | 2021-02-03T11:43:09.000Z | """SCons.Tool.gdc
Tool-specific initialization for the GDC compiler.
(https://github.com/D-Programming-GDC/GDC)
Developed by Russel Winder (russel@winder.org.uk)
2012-05-09 onwards
Compiler variables:
DC - The name of the D compiler to use. Defaults to gdc.
DPATH - List of paths to search for import modules... | 38.435714 | 128 | 0.693737 |
__revision__ = "src/engine/SCons/Tool/gdc.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import SCons.Action
import SCons.Defaults
import SCons.Tool
import SCons.Tool.DCommon
def generate(env):
static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
static_obj.add_action('.d', SCons.Defa... | true | true |
1c41860d2a7923dca193e3a89e401e2e5bd2cf72 | 33,054 | py | Python | boto/vpc/__init__.py | yola/boto | dccded53cc1eedd565fa50b32cadbdba3990225a | [
"MIT"
] | null | null | null | boto/vpc/__init__.py | yola/boto | dccded53cc1eedd565fa50b32cadbdba3990225a | [
"MIT"
] | null | null | null | boto/vpc/__init__.py | yola/boto | dccded53cc1eedd565fa50b32cadbdba3990225a | [
"MIT"
] | null | null | null | # Copyright (c) 2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, m... | 36.283205 | 110 | 0.621438 |
from boto.ec2.connection import EC2Connection
from boto.resultset import ResultSet
from boto.vpc.vpc import VPC
from boto.vpc.customergateway import CustomerGateway
from boto.vpc.routetable import RouteTable
from boto.vpc.internetgateway import InternetGateway
from boto.vpc.vpngateway import VpnGateway, Attachment
fr... | true | true |
1c4186e2439425542f19dd835149f20ff44767fe | 234 | py | Python | saleor/product_max_min/error_codes.py | hoangtuananh97/saleor | 94ad493ef61302fb458822868fc2b4a884ec2065 | [
"CC-BY-4.0"
] | null | null | null | saleor/product_max_min/error_codes.py | hoangtuananh97/saleor | 94ad493ef61302fb458822868fc2b4a884ec2065 | [
"CC-BY-4.0"
] | 4 | 2021-09-06T03:55:32.000Z | 2021-10-15T08:47:58.000Z | saleor/product_max_min/error_codes.py | hoangtuananh97/saleor | 94ad493ef61302fb458822868fc2b4a884ec2065 | [
"CC-BY-4.0"
] | null | null | null | from enum import Enum
class ProductMaxMinErrorCode(Enum):
ALREADY_EXISTS = "already_exists"
GRAPHQL_ERROR = "graphql_error"
INVALID = "invalid"
NOT_FOUND = "not_found"
REQUIRED = "required"
UNIQUE = "unique"
| 21.272727 | 37 | 0.696581 | from enum import Enum
class ProductMaxMinErrorCode(Enum):
ALREADY_EXISTS = "already_exists"
GRAPHQL_ERROR = "graphql_error"
INVALID = "invalid"
NOT_FOUND = "not_found"
REQUIRED = "required"
UNIQUE = "unique"
| true | true |
1c4187ab85b90cb3e63425592c1c4a9c55e75c74 | 2,908 | py | Python | src/primaires/vehicule/__init__.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 14 | 2015-08-21T19:15:21.000Z | 2017-11-26T13:59:17.000Z | src/primaires/vehicule/__init__.py | vincent-lg/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 20 | 2015-09-29T20:50:45.000Z | 2018-06-21T12:58:30.000Z | src/primaires/vehicule/__init__.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 3 | 2015-05-02T19:42:03.000Z | 2018-09-06T10:55:00.000Z | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 DAVY Guillaume
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
#... | 37.766234 | 79 | 0.69945 |
from abstraits.module import *
from .vehicule import Vehicule
from .vecteur import Vecteur
import time
VIRTSEC = 1
class Module(BaseModule):
def __init__(self, importeur):
BaseModule.__init__(self, importeur, "vehicule", "primaire")
self.commandes = []
self.vehicules = [... | true | true |
1c4187b0631d6e15249459ffc9c5679b90301371 | 2,560 | py | Python | modules/generator/aligner.py | vliu15/tts-gan | 6246c584a83f67dedaa25155c3b1491b99658319 | [
"MIT"
] | 12 | 2021-02-17T23:37:52.000Z | 2021-09-05T08:24:58.000Z | modules/generator/aligner.py | vliu15/tts-gan | 6246c584a83f67dedaa25155c3b1491b99658319 | [
"MIT"
] | null | null | null | modules/generator/aligner.py | vliu15/tts-gan | 6246c584a83f67dedaa25155c3b1491b99658319 | [
"MIT"
] | 2 | 2021-04-27T12:41:58.000Z | 2021-08-18T08:31:32.000Z | # Copyright (c) 2020 Vincent Liu
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distr... | 40 | 128 | 0.676953 |
import torch
import torch.nn as nn
import torch.nn.functional as F
class Aligner(nn.Module):
def __init__(self, gamma: float = 10.0):
super().__init__()
self.gamma = gamma
def forward(self, x_latents, x_lengths, x_mask, y_len, y_offset=None):
if y_offset is None:
y_offs... | true | true |
1c4187e00768efc44391aa55dd3463f0a0e8db54 | 789 | py | Python | convert_savedmodel.py | anhlnt/age-gender-estimation | 0a1c3a289a33c96c586ae8219911dbe51724f6d9 | [
"MIT"
] | null | null | null | convert_savedmodel.py | anhlnt/age-gender-estimation | 0a1c3a289a33c96c586ae8219911dbe51724f6d9 | [
"MIT"
] | null | null | null | convert_savedmodel.py | anhlnt/age-gender-estimation | 0a1c3a289a33c96c586ae8219911dbe51724f6d9 | [
"MIT"
] | null | null | null | import tensorflow as tf
from src.factory import get_model
from omegaconf import OmegaConf
from pathlib import Path
def getModel():
weight_file = "pretrained_models/EfficientNetB3_224_weights.26-3.15.hdf5"
model_name, img_size = Path(weight_file).stem.split("_")[:2]
print('model_name: ', model_name, 'img_... | 28.178571 | 98 | 0.723701 | import tensorflow as tf
from src.factory import get_model
from omegaconf import OmegaConf
from pathlib import Path
def getModel():
weight_file = "pretrained_models/EfficientNetB3_224_weights.26-3.15.hdf5"
model_name, img_size = Path(weight_file).stem.split("_")[:2]
print('model_name: ', model_name, 'img_... | true | true |
1c41884da87b914bbcb7a7f6201224677146687c | 11,952 | py | Python | telegram/EnglishBot.py | eprivalov/-k5-kt4ltj3l4rn3k4jrbjr34hbr3jhrv34 | 387cf92a275e5b1fc4f32d1638b62c65bcc8c1c5 | [
"Apache-2.0"
] | null | null | null | telegram/EnglishBot.py | eprivalov/-k5-kt4ltj3l4rn3k4jrbjr34hbr3jhrv34 | 387cf92a275e5b1fc4f32d1638b62c65bcc8c1c5 | [
"Apache-2.0"
] | null | null | null | telegram/EnglishBot.py | eprivalov/-k5-kt4ltj3l4rn3k4jrbjr34hbr3jhrv34 | 387cf92a275e5b1fc4f32d1638b62c65bcc8c1c5 | [
"Apache-2.0"
] | 1 | 2018-07-16T07:55:45.000Z | 2018-07-16T07:55:45.000Z | import telebot
import psycopg2
import re
from telebot import types
import datetime
"""
Команда Insydia приветствует вас.
Здесь вы можете узнать о последних новостях на нашем портале.
Мы будем поддерживать данное направление и обновлять функционал нашего робота.
Спасибо, что начали пользоваться InsydiaAsiaBot.
"""
TO... | 45.793103 | 194 | 0.536647 | import telebot
import psycopg2
import re
from telebot import types
import datetime
TOKEN = "196531742:AAGUaoxgMbin0gAAzOfulW58RPtbECrCkK0"
bot = telebot.TeleBot(TOKEN)
DB_NAME = "test"
USER = "testuser"
PASSWORD = "test"
CONNECT_DB = "dbname='%s' user='%s' host='' password='%s'" % (DB_NAME, USER, PASSWORD)
@bot.... | true | true |
1c418861fb6e75e48a46198115b66dd8dd3e8209 | 137 | py | Python | app/main/errors.py | geoffrey45/Baseline-news | d211a84e087a222cf1720808f4abe31b9315c632 | [
"MIT"
] | null | null | null | app/main/errors.py | geoffrey45/Baseline-news | d211a84e087a222cf1720808f4abe31b9315c632 | [
"MIT"
] | null | null | null | app/main/errors.py | geoffrey45/Baseline-news | d211a84e087a222cf1720808f4abe31b9315c632 | [
"MIT"
] | null | null | null | from flask import render_template
from . import main
@main.app_errorhandler(404)
def fof(error):
return render_template('fof.html'),404 | 22.833333 | 39 | 0.79562 | from flask import render_template
from . import main
@main.app_errorhandler(404)
def fof(error):
return render_template('fof.html'),404 | true | true |
1c4188cfd7f0d0d43d11e3f374e78faf058b8467 | 8,710 | py | Python | vkwave/bots/utils/keyboards/keyboard.py | krasnovmv/vkwave | e0db86cc16f97797765aadfb811ec87ff7945b1f | [
"MIT"
] | null | null | null | vkwave/bots/utils/keyboards/keyboard.py | krasnovmv/vkwave | e0db86cc16f97797765aadfb811ec87ff7945b1f | [
"MIT"
] | null | null | null | vkwave/bots/utils/keyboards/keyboard.py | krasnovmv/vkwave | e0db86cc16f97797765aadfb811ec87ff7945b1f | [
"MIT"
] | null | null | null | import json
import typing
from enum import Enum
from vkwave.bots.core.types.json_types import JSONEncoder
from vkwave.bots.utils.keyboards._types import Button
from vkwave.bots.utils.keyboards._vkpayaction import (
VKPayAction,
VKPayActionTransferToUser,
VKPayActionTransferToGroup,
VKPayActionPayToUse... | 27.916667 | 113 | 0.559013 | import json
import typing
from enum import Enum
from vkwave.bots.core.types.json_types import JSONEncoder
from vkwave.bots.utils.keyboards._types import Button
from vkwave.bots.utils.keyboards._vkpayaction import (
VKPayAction,
VKPayActionTransferToUser,
VKPayActionTransferToGroup,
VKPayActionPayToUse... | true | true |
1c41892a9cf0cd7b8e924beef7797f773203bc37 | 23,526 | py | Python | ClientGenerator/src/googleapis/codegen/api_test.py | Ramkarthik/google-api-dotnet-client | d752f96e8a6de53922c22eedc73ea7077628b106 | [
"Apache-2.0"
] | 3 | 2017-06-11T10:55:49.000Z | 2022-01-07T18:49:47.000Z | ClientGenerator/src/googleapis/codegen/api_test.py | Alexisblues/google-api-dotnet-client | c06374c2ebe79068add7ab445c4aa3308370fb8a | [
"Apache-2.0"
] | null | null | null | ClientGenerator/src/googleapis/codegen/api_test.py | Alexisblues/google-api-dotnet-client | c06374c2ebe79068add7ab445c4aa3308370fb8a | [
"Apache-2.0"
] | 2 | 2019-12-30T03:32:56.000Z | 2022-03-21T10:19:38.000Z | #!/usr/bin/python2.7
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 39.21 | 80 | 0.655233 |
__author__ = 'aiuto@google.com (Tony Aiuto)'
import json
import os
import gflags as flags
from google.apputils import basetest
from googleapis.codegen import data_types
from googleapis.codegen import language_model
from googleapis.codegen.api import Api
from googleapis.codegen.api import AuthScope
from googleapis... | true | true |
1c41896d23db8966b5ca3fc9304f280ab04c2298 | 126 | py | Python | pychatwork/api/model/Account.py | a-yasui/pyChatWork | 5a4d60d8927ee288bdaafe86d09c6c5065bebccb | [
"MIT"
] | null | null | null | pychatwork/api/model/Account.py | a-yasui/pyChatWork | 5a4d60d8927ee288bdaafe86d09c6c5065bebccb | [
"MIT"
] | null | null | null | pychatwork/api/model/Account.py | a-yasui/pyChatWork | 5a4d60d8927ee288bdaafe86d09c6c5065bebccb | [
"MIT"
] | null | null | null | # coding: utf-8
from . import Model
class Account (Model):
def __init__(self, data):
Model.__init__(self, data)
| 15.75 | 34 | 0.650794 |
from . import Model
class Account (Model):
def __init__(self, data):
Model.__init__(self, data)
| true | true |
1c41898a988ebc460ec7deaedfd5f5390c2f5fb8 | 1,844 | py | Python | colour/models/rgb/__init__.py | gutenzwerg/colour | 299eceb57483213e2544d532a6d3727887e49426 | [
"BSD-3-Clause"
] | 6 | 2019-06-18T18:53:29.000Z | 2021-09-10T21:02:45.000Z | colour/models/rgb/__init__.py | gutenzwerg/colour | 299eceb57483213e2544d532a6d3727887e49426 | [
"BSD-3-Clause"
] | null | null | null | colour/models/rgb/__init__.py | gutenzwerg/colour | 299eceb57483213e2544d532a6d3727887e49426 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from .derivation import (normalised_primary_matrix,
chromatically_adapted_primaries, primaries_whitepoint,
RGB_luminance_equation, RGB_luminance)
from .rgb_colourspace import RGB_Colourspace
from .rgb_colourspace import XYZ_to_RGB, RGB_to_XYZ
fr... | 44.97561 | 79 | 0.756508 |
from .derivation import (normalised_primary_matrix,
chromatically_adapted_primaries, primaries_whitepoint,
RGB_luminance_equation, RGB_luminance)
from .rgb_colourspace import RGB_Colourspace
from .rgb_colourspace import XYZ_to_RGB, RGB_to_XYZ
from .rgb_colourspace impo... | true | true |
1c418a5bd251b0ee4e7ca16f98c471e981f7b315 | 50,101 | py | Python | src/cclib/parser/adfparser.py | maxscheurer/cclib | 722a8b534686465d4e3ae57b8dd285a56f197e4a | [
"BSD-3-Clause"
] | null | null | null | src/cclib/parser/adfparser.py | maxscheurer/cclib | 722a8b534686465d4e3ae57b8dd285a56f197e4a | [
"BSD-3-Clause"
] | null | null | null | src/cclib/parser/adfparser.py | maxscheurer/cclib | 722a8b534686465d4e3ae57b8dd285a56f197e4a | [
"BSD-3-Clause"
] | null | null | null | ## -*- coding: utf-8 -*-
#
# Copyright (c) 2017, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Parser for ADF output files"""
from __future__ import print_function
import itertools
import re
impor... | 43.415078 | 159 | 0.479352 |
from __future__ import print_function
import itertools
import re
import numpy
from cclib.parser import logfileparser
from cclib.parser import utils
class ADF(logfileparser.Logfile):
def __init__(self, *args, **kwargs):
super(ADF, self).__init__(logname="ADF", *args, **kwarg... | true | true |
1c418ae6d868b44c271c4cbc30d61ab7f197e815 | 11,954 | py | Python | tests/integration/cqlengine/test_lwt_conditional.py | clohfink/python-driver | 30a0e27cd1b8999267c146f0a93adf962a50790b | [
"Apache-2.0"
] | 1,163 | 2015-01-01T03:02:05.000Z | 2022-03-22T13:04:00.000Z | tests/integration/cqlengine/test_lwt_conditional.py | clohfink/python-driver | 30a0e27cd1b8999267c146f0a93adf962a50790b | [
"Apache-2.0"
] | 556 | 2015-01-05T16:39:29.000Z | 2022-03-26T20:51:36.000Z | tests/integration/cqlengine/test_lwt_conditional.py | clohfink/python-driver | 30a0e27cd1b8999267c146f0a93adf962a50790b | [
"Apache-2.0"
] | 449 | 2015-01-05T10:28:59.000Z | 2022-03-14T23:15:32.000Z | # Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | 39.846667 | 111 | 0.672829 | try:
import unittest2 as unittest
except ImportError:
import unittest
import mock
import six
from uuid import uuid4
from cassandra.cqlengine import columns
from cassandra.cqlengine.management import sync_table, drop_table
from cassandra.cqlengine.models import Model
from cassandra.cqlengine.query import Batc... | true | true |
1c418c2e5c01c544657d9dfe132516af41943430 | 3,027 | py | Python | survey_app_repo/survey/tests/factory.py | devbkhadka/survey_app | 51c4a4844e57f771d1157be8a8307552d390df67 | [
"Apache-1.1"
] | 1 | 2020-01-12T06:48:28.000Z | 2020-01-12T06:48:28.000Z | survey_app_repo/survey/tests/factory.py | devbkhadka/survey_app | 51c4a4844e57f771d1157be8a8307552d390df67 | [
"Apache-1.1"
] | null | null | null | survey_app_repo/survey/tests/factory.py | devbkhadka/survey_app | 51c4a4844e57f771d1157be8a8307552d390df67 | [
"Apache-1.1"
] | null | null | null | '''Utility function to populate data needed for tests'''
from ..models import Survey, Question, QuestionTypes, SurveyResponse, ResponseText
RAW_SURVEYS = [
{
'title': 'Your favourite candidate',
'summary': 'Answer questions like who is your favourite candidate and why',
'published_date': '... | 31.863158 | 109 | 0.648827 | from ..models import Survey, Question, QuestionTypes, SurveyResponse, ResponseText
RAW_SURVEYS = [
{
'title': 'Your favourite candidate',
'summary': 'Answer questions like who is your favourite candidate and why',
'published_date': '2019-4-20 00:00+0545',
},
{
'title': 'You... | true | true |
1c418cfcc6d1ee460a06ff697a614c2418050041 | 393 | py | Python | yatube/yatube/urls.py | themasterid/hw02_community | 8e9980df3f10bb00ee521d92079313dafa9af066 | [
"MIT"
] | null | null | null | yatube/yatube/urls.py | themasterid/hw02_community | 8e9980df3f10bb00ee521d92079313dafa9af066 | [
"MIT"
] | null | null | null | yatube/yatube/urls.py | themasterid/hw02_community | 8e9980df3f10bb00ee521d92079313dafa9af066 | [
"MIT"
] | null | null | null | # yatube/urls.py
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('auth/', include('users.urls', namespace='users')),
path('auth/', include('django.contrib.auth.urls')),
path('admin/', admin.site.urls),
path('', include('posts.urls', namespace='index')),
#... | 32.75 | 75 | 0.659033 | from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('auth/', include('users.urls', namespace='users')),
path('auth/', include('django.contrib.auth.urls')),
path('admin/', admin.site.urls),
path('', include('posts.urls', namespace='index')),
]
| true | true |
1c418d5da30c5843481756efb37736bb9b1e5529 | 621 | py | Python | problems/general_abbr.py | stachenov/PyLeetCode | cb13700d428854eff46a762542a63d691578d5b6 | [
"Unlicense"
] | null | null | null | problems/general_abbr.py | stachenov/PyLeetCode | cb13700d428854eff46a762542a63d691578d5b6 | [
"Unlicense"
] | null | null | null | problems/general_abbr.py | stachenov/PyLeetCode | cb13700d428854eff46a762542a63d691578d5b6 | [
"Unlicense"
] | null | null | null | class Solution(object):
def generateAbbreviations(self, word):
"""
:type word: str
:rtype: List[str]
"""
def generate(abbr, pos):
if pos == len(word):
yield abbr
else:
if not abbr or not abbr[-1].isdigit():
... | 34.5 | 71 | 0.431562 | class Solution(object):
def generateAbbreviations(self, word):
def generate(abbr, pos):
if pos == len(word):
yield abbr
else:
if not abbr or not abbr[-1].isdigit():
for i in xrange(pos + 1, len(word) + 1):
fo... | true | true |
1c418d6be54f413656434d3aadc217088071f2b0 | 535 | py | Python | main_app/migrations/0002_alter_golfgroup_members.py | makmizi15/golfhub | 9073a990e2ddebf1bc346d3d49ccd6c4dd8d79ce | [
"MIT"
] | null | null | null | main_app/migrations/0002_alter_golfgroup_members.py | makmizi15/golfhub | 9073a990e2ddebf1bc346d3d49ccd6c4dd8d79ce | [
"MIT"
] | null | null | null | main_app/migrations/0002_alter_golfgroup_members.py | makmizi15/golfhub | 9073a990e2ddebf1bc346d3d49ccd6c4dd8d79ce | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-11-19 08:47
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('main_app', '0001_initial'),
]
operations = [
... | 25.47619 | 105 | 0.657944 |
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('main_app', '0001_initial'),
]
operations = [
migrations.AlterField(
model_na... | true | true |
1c418e20e64c922867e06acee53a789cc13d54f7 | 2,416 | py | Python | alien_fullfunction/scoreboard.py | yiyidhuang/PythonCrashCrouse2nd | 3512f9ab8fcf32c6145604a37e2a62feddf174d1 | [
"MIT"
] | null | null | null | alien_fullfunction/scoreboard.py | yiyidhuang/PythonCrashCrouse2nd | 3512f9ab8fcf32c6145604a37e2a62feddf174d1 | [
"MIT"
] | null | null | null | alien_fullfunction/scoreboard.py | yiyidhuang/PythonCrashCrouse2nd | 3512f9ab8fcf32c6145604a37e2a62feddf174d1 | [
"MIT"
] | null | null | null | import pygame.font
from pygame.sprite import Group
from ship import Ship
class Scoreboard:
def __init__(self, ai_game):
self.ai_game = ai_game
self.screen = ai_game.screen
self.screen_rect = self.screen.get_rect()
self.settings = ai_game.settings
self.stats = ai_game.stats... | 35.529412 | 111 | 0.647351 | import pygame.font
from pygame.sprite import Group
from ship import Ship
class Scoreboard:
def __init__(self, ai_game):
self.ai_game = ai_game
self.screen = ai_game.screen
self.screen_rect = self.screen.get_rect()
self.settings = ai_game.settings
self.stats = ai_game.stats... | true | true |
1c418e5cf2168c58612ee32837893a2edc13243f | 23,804 | py | Python | python/tvm/target/target.py | embodyme/tvm | 3c05eb6a4bc026b7b194e6708d96b2dc9eea070a | [
"Apache-2.0"
] | 8 | 2021-08-02T14:17:39.000Z | 2021-11-16T12:37:51.000Z | python/tvm/target/target.py | redbopo/tvm | b54beed37ca2baad6002990b014a2119223e0900 | [
"Apache-2.0"
] | null | null | null | python/tvm/target/target.py | redbopo/tvm | b54beed37ca2baad6002990b014a2119223e0900 | [
"Apache-2.0"
] | 7 | 2021-08-03T14:24:00.000Z | 2021-11-11T04:34:37.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.528358 | 100 | 0.596286 | import json
import os
import re
import warnings
import tvm._ffi
from tvm._ffi import register_func as _register_func
from tvm.runtime import Object
from . import _ffi_api
@tvm._ffi.register_object
class TargetKind(Object):
@property
def options(self):
return dict(_ffi_api.ListTargetKindOptions(self... | true | true |
1c418edd52415a476c4b7126f0a4eb8c8d888556 | 3,345 | py | Python | source/position/position.py | homeoffice-ys/EliteQuant_Python | 4384494b9abe2b2622752bd59532efcdc034bc1c | [
"Apache-2.0"
] | 51 | 2019-02-01T19:43:37.000Z | 2022-03-16T09:07:03.000Z | source/position/position.py | ajmal017/EliteQuant_Python | 28ed64d742d9f010836d4070cd26bab78d9623d0 | [
"Apache-2.0"
] | 2 | 2019-02-23T18:54:22.000Z | 2019-11-09T01:30:32.000Z | source/position/position.py | ajmal017/EliteQuant_Python | 28ed64d742d9f010836d4070cd26bab78d9623d0 | [
"Apache-2.0"
] | 35 | 2019-02-08T02:00:31.000Z | 2022-03-01T23:17:00.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ..util.util_func import retrieve_multiplier_from_full_symbol
class Position(object):
def __init__(self, full_symbol, average_price, size, realized_pnl=0):
"""
Position includes zero/closed security
"""
## TODO: add cumulative_commis... | 51.461538 | 115 | 0.560837 | from ..util.util_func import retrieve_multiplier_from_full_symbol
class Position(object):
def __init__(self, full_symbol, average_price, size, realized_pnl=0):
self.full_symbol = full_symbol
self.average_price = average_price
self.size = size
self.realized_pnl = 0
... | true | true |
1c418f004546888f8db9ad78d063e787719b2295 | 798 | py | Python | hypervector/scripts/get.py | ploomber/posts | 5f739cf04ff77932c34d5d3ad8d6d94dfe97f051 | [
"Apache-2.0"
] | 15 | 2020-11-30T19:31:30.000Z | 2022-01-16T15:09:16.000Z | hypervector/scripts/get.py | ploomber/posts | 5f739cf04ff77932c34d5d3ad8d6d94dfe97f051 | [
"Apache-2.0"
] | 3 | 2022-01-13T03:51:14.000Z | 2022-03-12T01:01:41.000Z | hypervector/scripts/get.py | ploomber/posts | 5f739cf04ff77932c34d5d3ad8d6d94dfe97f051 | [
"Apache-2.0"
] | 8 | 2021-07-28T02:19:00.000Z | 2022-02-06T16:03:24.000Z | # ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.11.4
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
import pandas as pd
from sklearn.datasets ... | 22.8 | 78 | 0.681704 |
import pandas as pd
from sklearn.datasets import load_iris
upstream = None
product = None
df = load_iris(as_frame=True)['frame']
df.head()
df.to_csv(product['data'], index=False)
| true | true |
1c418f3ddc2e63804d591924c6ec31465718f551 | 19,596 | py | Python | python/ccxt/bitforex.py | lottaeouss/ccxt | 694fd3dc30154057f6c2310920552329df973031 | [
"MIT"
] | null | null | null | python/ccxt/bitforex.py | lottaeouss/ccxt | 694fd3dc30154057f6c2310920552329df973031 | [
"MIT"
] | 2 | 2019-06-24T02:24:54.000Z | 2019-07-03T01:43:45.000Z | python/ccxt/bitforex.py | lottaeouss/ccxt | 694fd3dc30154057f6c2310920552329df973031 | [
"MIT"
] | 1 | 2019-08-07T15:44:10.000Z | 2019-08-07T15:44:10.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestri... | 36.022059 | 126 | 0.414676 |
from ccxt.base.exchange import Exchange
try:
basestring except NameError:
basestring = str from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import OrderNotFound
from ccxt.base.errors import DDoS... | true | true |
1c41907c50737308182a896121ca20a6a7ad4dda | 28,565 | py | Python | iasi/evaluation.py | Peter42/iasi | fc799d542c2bb80c3f559bc2f9e833ac330a5506 | [
"MIT"
] | null | null | null | iasi/evaluation.py | Peter42/iasi | fc799d542c2bb80c3f559bc2f9e833ac330a5506 | [
"MIT"
] | 3 | 2019-05-02T12:49:21.000Z | 2019-06-12T09:11:00.000Z | iasi/evaluation.py | Peter42/iasi | fc799d542c2bb80c3f559bc2f9e833ac330a5506 | [
"MIT"
] | 1 | 2019-10-18T21:33:33.000Z | 2019-10-18T21:33:33.000Z | from functools import partial
import math
import os
import luigi
import numpy as np
import pandas as pd
from netCDF4 import Dataset, Group, Variable
from sklearn.model_selection import ParameterGrid
from iasi.composition import Composition
from iasi.compression import CompressDataset, SelectSingleVariable, Decompress... | 41.278902 | 160 | 0.572729 | from functools import partial
import math
import os
import luigi
import numpy as np
import pandas as pd
from netCDF4 import Dataset, Group, Variable
from sklearn.model_selection import ParameterGrid
from iasi.composition import Composition
from iasi.compression import CompressDataset, SelectSingleVariable, Decompress... | true | true |
1c4190c63cbc40bfd1c9d373ca0d6076c0b40b36 | 2,082 | py | Python | migrations/0002_pymbawallpage_pymbawallpagelayers.py | andywar65/pymba | 119cbab973638c127e6e736b08fdb8235a7537a6 | [
"BSD-2-Clause"
] | 3 | 2020-04-20T05:34:30.000Z | 2020-11-04T07:25:26.000Z | migrations/0002_pymbawallpage_pymbawallpagelayers.py | andywar65/pymba | 119cbab973638c127e6e736b08fdb8235a7537a6 | [
"BSD-2-Clause"
] | null | null | null | migrations/0002_pymbawallpage_pymbawallpagelayers.py | andywar65/pymba | 119cbab973638c127e6e736b08fdb8235a7537a6 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-02-04 19:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0019_delete_fil... | 42.489796 | 191 | 0.595581 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0019_delete_filter'),
('wagtailcore', '0040_page_draft_title'),
('pymba'... | true | true |
1c4191007d0a6c4b0419d38678ca62d430bd0f52 | 184 | py | Python | Scripts/django-admin.py | dragonrathony/zed_market | c73f17501608c8fe86692c3c4f6e03fc8ba03286 | [
"bzip2-1.0.6"
] | 1 | 2020-06-17T13:45:54.000Z | 2020-06-17T13:45:54.000Z | Scripts/django-admin.py | Honey4251996/zed_market | c73f17501608c8fe86692c3c4f6e03fc8ba03286 | [
"bzip2-1.0.6"
] | 11 | 2021-03-19T07:55:39.000Z | 2022-03-12T00:34:55.000Z | Scripts/django-admin.py | Honey4251996/zed_market | c73f17501608c8fe86692c3c4f6e03fc8ba03286 | [
"bzip2-1.0.6"
] | null | null | null | #!d:\projects\eric\python\django\zed-market\dev\zed-market\scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 30.666667 | 77 | 0.788043 | from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| true | true |
1c41911f837ca62f3884f8c0ec85b9f5430f4763 | 298 | py | Python | tests/enums/test_service_module_name.py | jbpratt78/mypy_boto3_builder | be4020782369b34e35f3b6a2117f00d947f3ae24 | [
"MIT"
] | null | null | null | tests/enums/test_service_module_name.py | jbpratt78/mypy_boto3_builder | be4020782369b34e35f3b6a2117f00d947f3ae24 | [
"MIT"
] | null | null | null | tests/enums/test_service_module_name.py | jbpratt78/mypy_boto3_builder | be4020782369b34e35f3b6a2117f00d947f3ae24 | [
"MIT"
] | null | null | null | from mypy_boto3_builder.enums.service_module_name import ServiceModuleName
class TestServiceModuleName:
def test_properties(self) -> None:
assert ServiceModuleName.paginator.file_name == "paginator.py"
assert ServiceModuleName.paginator.template_name == "paginator.py.jinja2"
| 37.25 | 81 | 0.788591 | from mypy_boto3_builder.enums.service_module_name import ServiceModuleName
class TestServiceModuleName:
def test_properties(self) -> None:
assert ServiceModuleName.paginator.file_name == "paginator.py"
assert ServiceModuleName.paginator.template_name == "paginator.py.jinja2"
| true | true |
1c419190ff52c84309e46af3e38f91362aba2c9c | 2,072 | py | Python | clients/gui/gui.py | adlerweb/pyprologix | 818ec301aee5ff051c415f03308acee96d3c5cd8 | [
"MIT"
] | 1 | 2021-01-22T14:35:29.000Z | 2021-01-22T14:35:29.000Z | clients/gui/gui.py | adlerweb/pyprologix | 818ec301aee5ff051c415f03308acee96d3c5cd8 | [
"MIT"
] | null | null | null | clients/gui/gui.py | adlerweb/pyprologix | 818ec301aee5ff051c415f03308acee96d3c5cd8 | [
"MIT"
] | null | null | null | # helloworld.py
import tkinter as tk
import pygubu
#Folder with hp3478a.py/prologix.py must be in PYTHONPATH
#Alternatively copy them to this folder
from hp3478a import hp3478a
from time import sleep
port = "/dev/ttyACM0"
test = hp3478a(23, port, debug=True)
test.getStatus()
class HelloWorldApp:
def __ini... | 28.383562 | 74 | 0.53668 | import tkinter as tk
import pygubu
from hp3478a import hp3478a
from time import sleep
port = "/dev/ttyACM0"
test = hp3478a(23, port, debug=True)
test.getStatus()
class HelloWorldApp:
def __init__(self):
self.builder = builder = pygubu.Builder()
builder.add_from_file('../g... | true | true |
1c4191c1d2a32493fac86efbe6f1aa2a6fee1ce3 | 203 | py | Python | cassiopeia/datastores/__init__.py | mertkutay/cassiopeia | 1c4005f78f216322d179f3465303d105261beab2 | [
"MIT"
] | null | null | null | cassiopeia/datastores/__init__.py | mertkutay/cassiopeia | 1c4005f78f216322d179f3465303d105261beab2 | [
"MIT"
] | null | null | null | cassiopeia/datastores/__init__.py | mertkutay/cassiopeia | 1c4005f78f216322d179f3465303d105261beab2 | [
"MIT"
] | null | null | null | from .cache import Cache
from .riotapi import RiotAPI
from .ddragon import DDragon
from .ghost import UnloadedGhostStore
from .merakianalyticscdn import MerakiAnalyticsCDN
from .lolwikia import LolWikia
| 29 | 50 | 0.852217 | from .cache import Cache
from .riotapi import RiotAPI
from .ddragon import DDragon
from .ghost import UnloadedGhostStore
from .merakianalyticscdn import MerakiAnalyticsCDN
from .lolwikia import LolWikia
| true | true |
1c41931e27ca720f8e8be0a8a09a2bbb093b36d0 | 11,055 | py | Python | cert_tools.py | fizyr/ca-scripts | 2b558a04f51392f0884c4c9abf3df9dc0dcf4a7a | [
"BSD-3-Clause"
] | null | null | null | cert_tools.py | fizyr/ca-scripts | 2b558a04f51392f0884c4c9abf3df9dc0dcf4a7a | [
"BSD-3-Clause"
] | null | null | null | cert_tools.py | fizyr/ca-scripts | 2b558a04f51392f0884c4c9abf3df9dc0dcf4a7a | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017-2019 Fizyr B.V. - https://fizyr.com
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the fol... | 30.793872 | 147 | 0.739213 |
import os
from datetime import datetime, timedelta
from pathlib import Path
from typing import Iterable, List, Tuple, Optional, Generator
from cryptography import x509
from cryptography.x509.oid import NameOID, ExtendedKeyUsageOID
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.backends im... | true | true |
1c4193c598a6936a19a00092d44a1b489fef5b33 | 13,515 | py | Python | tests/test_seerpy.py | matias-seer/seer-py | fbb018e683817d108f2e1ee3162680de06ce110c | [
"MIT"
] | null | null | null | tests/test_seerpy.py | matias-seer/seer-py | fbb018e683817d108f2e1ee3162680de06ce110c | [
"MIT"
] | null | null | null | tests/test_seerpy.py | matias-seer/seer-py | fbb018e683817d108f2e1ee3162680de06ce110c | [
"MIT"
] | null | null | null | # Copyright 2017,2018 Seer Medical Pty Ltd, Inc. or its affiliates. All Rights Reserved.
import json
import pathlib
from unittest import mock
import pytest
import pandas as pd
from seerpy.seerpy import SeerConnect
# having a class is useful to allow patches to be shared across mutliple test functions, but then
# p... | 36.527027 | 100 | 0.658454 |
import json
import pathlib
from unittest import mock
import pytest
import pandas as pd
from seerpy.seerpy import SeerConnect
TEST_DATA_DIR = pathlib.Path(__file__).parent / "test_data"
@mock.patch('seerpy.seerpy.SeerAuth', autospec=True)
class TestSeerConnect:
def test_success(self, seer_auth):
s... | true | true |
1c4193dd25e08f5ede3d53f5443722355b2807e2 | 2,972 | py | Python | CalibTracker/SiStripESProducers/test/python/templateCheckAllIOVs_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CalibTracker/SiStripESProducers/test/python/templateCheckAllIOVs_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CalibTracker/SiStripESProducers/test/python/templateCheckAllIOVs_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | from __future__ import print_function
def pack(high,low):
"""pack high,low 32bit unsigned int to one unsigned 64bit long long
Note:the print value of result number may appear signed, if the sign bit is used.
"""
h=high<<32
return (h|low)
def secondsFromString(i):
"""convert from a string in ... | 35.380952 | 105 | 0.688762 | from __future__ import print_function
def pack(high,low):
h=high<<32
return (h|low)
def secondsFromString(i):
import time
return int(time.mktime(time.strptime(i, "%d/%m/%Y %H:%M:%S")))
def packFromString(i):
return pack(secondsFromString(i), 0)
def intervalSinceEpoch(i):
return( packFromStrin... | true | true |
1c419467f0489fbf76fb84c4e1abbc3e19d99fa2 | 4,519 | py | Python | test/test_planner.py | liespace/pyRRTs | 11bfefad99218bc9eccd97040355c61d34a1181d | [
"MIT"
] | 2 | 2021-01-22T09:12:49.000Z | 2021-05-06T14:22:05.000Z | test/test_planner.py | liespace/pyRRTs | 11bfefad99218bc9eccd97040355c61d34a1181d | [
"MIT"
] | null | null | null | test/test_planner.py | liespace/pyRRTs | 11bfefad99218bc9eccd97040355c61d34a1181d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from copy import deepcopy
import numpy as np
import matplotlib.pyplot as plt
import cv2
from matplotlib.patches import Polygon
from rrts import BiRRTStar, RRTStar
from rrts.debugger import Debugger
def center2rear(node, wheelbase=2.96):
"""calculate the coordinate of rear track center accord... | 37.658333 | 117 | 0.610976 | from copy import deepcopy
import numpy as np
import matplotlib.pyplot as plt
import cv2
from matplotlib.patches import Polygon
from rrts import BiRRTStar, RRTStar
from rrts.debugger import Debugger
def center2rear(node, wheelbase=2.96):
if not isinstance(node, RRTStar.StateNode):
theta, r = node[2] + np.p... | true | true |
1c4194c7656fce73d5fad96f635e541689d9d119 | 5,576 | py | Python | pp/components/mzi.py | flaport/gdsfactory | 1f2e844c1fe27b9c6340e2d51500fd3358fa16e5 | [
"MIT"
] | 8 | 2020-08-25T11:25:18.000Z | 2022-03-27T11:32:11.000Z | pp/components/mzi.py | flaport/gdsfactory | 1f2e844c1fe27b9c6340e2d51500fd3358fa16e5 | [
"MIT"
] | null | null | null | pp/components/mzi.py | flaport/gdsfactory | 1f2e844c1fe27b9c6340e2d51500fd3358fa16e5 | [
"MIT"
] | 1 | 2022-03-04T07:03:29.000Z | 2022-03-04T07:03:29.000Z | from typing import Callable, Optional
import pp
from pp.component import Component
from pp.components.bend_circular import bend_circular as bend_circular_function
from pp.components.mmi1x2 import mmi1x2 as mmi1x2_function
from pp.components.waveguide import waveguide as waveguide_function
from pp.port import deco_rena... | 28.44898 | 82 | 0.610294 | from typing import Callable, Optional
import pp
from pp.component import Component
from pp.components.bend_circular import bend_circular as bend_circular_function
from pp.components.mmi1x2 import mmi1x2 as mmi1x2_function
from pp.components.waveguide import waveguide as waveguide_function
from pp.port import deco_rena... | true | true |
1c419683f0766e2e4f3d5773217d2f84c05adb42 | 19,486 | py | Python | code/apps/Managed Software Center/Managed Software Center/AlertController.py | erikng/munki | 24dc96512f41fa3fa7a5cf064fbbedc9f2d71e14 | [
"Apache-2.0"
] | 1 | 2018-07-25T21:29:43.000Z | 2018-07-25T21:29:43.000Z | code/apps/Managed Software Center/Managed Software Center/AlertController.py | bruienne/munki | 55936d96ed2f45ede1469873836d61596486020a | [
"Apache-2.0"
] | null | null | null | code/apps/Managed Software Center/Managed Software Center/AlertController.py | bruienne/munki | 55936d96ed2f45ede1469873836d61596486020a | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
#
# AlertController.py
# Managed Software Center
#
# Created by Greg Neagle on 2/25/14.
#
import os
#import sys
import munki
import msclog
import MunkiItems
from objc import nil
from AppKit import *
from Foundation import *
from PyObjCTools import AppHelper
# Disable PyLint complaining about 'i... | 48.232673 | 122 | 0.605563 |
import os
import munki
import msclog
import MunkiItems
from objc import nil
from AppKit import *
from Foundation import *
from PyObjCTools import AppHelper
class AlertController(NSObject):
def setWindow_(self, the_window):
self.window = the_window
def forcedLogoutWarning(self, notification_obj):
... | true | true |
1c4196b797c7b2af1a73d65d76478c267982039c | 2,093 | py | Python | dpkt/aoe.py | sergedroz/dpkt | 90928c5baaf36e76d8b62a973924af3c96b9e160 | [
"BSD-3-Clause"
] | null | null | null | dpkt/aoe.py | sergedroz/dpkt | 90928c5baaf36e76d8b62a973924af3c96b9e160 | [
"BSD-3-Clause"
] | null | null | null | dpkt/aoe.py | sergedroz/dpkt | 90928c5baaf36e76d8b62a973924af3c96b9e160 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""ATA over Ethernet Protocol."""
from __future__ import absolute_import
import struct
from . import dpkt
from .compat import iteritems
class AOE(dpkt.Packet):
"""ATA over Ethernet Protocol.
See more about the AOE on
https://en.wikipedia.org/wiki/ATA_over_Ethernet
Attribute... | 22.265957 | 75 | 0.553273 | from __future__ import absolute_import
import struct
from . import dpkt
from .compat import iteritems
class AOE(dpkt.Packet):
__hdr__ = (
('ver_fl', 'B', 0x10),
('err', 'B', 0),
('maj', 'H', 0),
('min', 'B', 0),
('cmd', 'B', 0),
('tag', 'I', 0),
)
_cmdsw ... | true | true |
1c419735e1b86b5592261ddb7ee7d85c8a498907 | 8,576 | py | Python | python/smqtk/representation/data_set/memory_set.py | joshanderson-kw/SMQTK | 594e7c733fe7f4e514a1a08a7343293a883a41fc | [
"BSD-3-Clause"
] | 82 | 2015-01-07T15:33:29.000Z | 2021-08-11T18:34:05.000Z | python/smqtk/representation/data_set/memory_set.py | joshanderson-kw/SMQTK | 594e7c733fe7f4e514a1a08a7343293a883a41fc | [
"BSD-3-Clause"
] | 230 | 2015-04-08T14:36:51.000Z | 2022-03-14T17:55:30.000Z | python/smqtk/representation/data_set/memory_set.py | joshanderson-kw/SMQTK | 594e7c733fe7f4e514a1a08a7343293a883a41fc | [
"BSD-3-Clause"
] | 65 | 2015-01-04T15:00:16.000Z | 2021-11-19T18:09:11.000Z | import threading
from six.moves import cPickle as pickle
from smqtk.exceptions import ReadOnlyError
from smqtk.representation import DataElement, DataSet
from smqtk.utils import SimpleTimer
from smqtk.utils.configuration import (
from_config_dict,
make_default_config,
to_config_dict
)
from smqtk.utils.dic... | 34.304 | 80 | 0.626049 | import threading
from six.moves import cPickle as pickle
from smqtk.exceptions import ReadOnlyError
from smqtk.representation import DataElement, DataSet
from smqtk.utils import SimpleTimer
from smqtk.utils.configuration import (
from_config_dict,
make_default_config,
to_config_dict
)
from smqtk.utils.dic... | true | true |
1c419981242a0c02bdf3b073d38a4aae22d392bb | 11,458 | py | Python | openfl/component/director/director.py | katerina-merkulova/openfl | acee1877f7dfc0bf22db60a4eda51040b5b46f47 | [
"Apache-2.0"
] | 1 | 2022-03-29T17:17:05.000Z | 2022-03-29T17:17:05.000Z | openfl/component/director/director.py | eceisik/openfl | 050b8354b698a34b5ef01f0f55f968f52f63f84d | [
"Apache-2.0"
] | null | null | null | openfl/component/director/director.py | eceisik/openfl | 050b8354b698a34b5ef01f0f55f968f52f63f84d | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Director module."""
import asyncio
import logging
import time
from collections import defaultdict
from pathlib import Path
from typing import Iterable
from typing import List
from typing import Union
from .experiment import Experime... | 36.724359 | 99 | 0.615902 |
import asyncio
import logging
import time
from collections import defaultdict
from pathlib import Path
from typing import Iterable
from typing import List
from typing import Union
from .experiment import Experiment
from .experiment import ExperimentsRegistry
from .experiment import Status
logger = logging.getLogger... | true | true |
1c419a04555d4fdaff326fd6472ff1513b1436f9 | 893 | py | Python | bukber/admin.py | ppabcd/django-bukber | 8a5d272e988a63082977deb5ba026876d4c70ee4 | [
"BSD-3-Clause"
] | null | null | null | bukber/admin.py | ppabcd/django-bukber | 8a5d272e988a63082977deb5ba026876d4c70ee4 | [
"BSD-3-Clause"
] | null | null | null | bukber/admin.py | ppabcd/django-bukber | 8a5d272e988a63082977deb5ba026876d4c70ee4 | [
"BSD-3-Clause"
] | null | null | null | from admin_totals.admin import ModelAdminTotals
from django.contrib import admin
from django.db.models import Sum
from django.db.models.functions import Coalesce
from .models import Kelas, Peserta
# Register your models here.
class PesertaAdmin(ModelAdminTotals):
exclude = ['created_at', 'updated_at']
list_d... | 24.805556 | 71 | 0.668533 | from admin_totals.admin import ModelAdminTotals
from django.contrib import admin
from django.db.models import Sum
from django.db.models.functions import Coalesce
from .models import Kelas, Peserta
class PesertaAdmin(ModelAdminTotals):
exclude = ['created_at', 'updated_at']
list_display = [
'nama',
... | true | true |
1c419a0af3fb5953370a1109197f3b4f8405af08 | 5,357 | py | Python | simpleppt/SimplePPT.py | LouisFaure/simpleppt | 466c73fc64b9c4e3bf14b2c46c11d69de31c8a9b | [
"BSD-3-Clause"
] | null | null | null | simpleppt/SimplePPT.py | LouisFaure/simpleppt | 466c73fc64b9c4e3bf14b2c46c11d69de31c8a9b | [
"BSD-3-Clause"
] | null | null | null | simpleppt/SimplePPT.py | LouisFaure/simpleppt | 466c73fc64b9c4e3bf14b2c46c11d69de31c8a9b | [
"BSD-3-Clause"
] | null | null | null | from typing import Any, Union, Optional, Mapping, Iterable # Meta
from typing import Mapping
import numpy as np
import igraph
from sklearn.metrics import pairwise_distances
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import shortest_path
import pandas as pd
import itertools
class SimplePPT:
"""... | 32.271084 | 85 | 0.550308 | from typing import Any, Union, Optional, Mapping, Iterable from typing import Mapping
import numpy as np
import igraph
from sklearn.metrics import pairwise_distances
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import shortest_path
import pandas as pd
import itertools
class SimplePPT:
def __ini... | true | true |
1c419a9890ffa661f4b93e3f7cb17869f69aa93e | 5,814 | py | Python | py/parseMidi.py | Lazersmoke/idawator-hacking | 12db250afa6f0192041a233339db535edbc72f86 | [
"MIT"
] | null | null | null | py/parseMidi.py | Lazersmoke/idawator-hacking | 12db250afa6f0192041a233339db535edbc72f86 | [
"MIT"
] | null | null | null | py/parseMidi.py | Lazersmoke/idawator-hacking | 12db250afa6f0192041a233339db535edbc72f86 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import minimize
from scipy.io import wavfile
from scipy.signal import hilbert
from scipy.special import binom
from mido import MidiFile
import itertools
import nonlin
fockSize = 10
# Pitch class, octave
sizeOfNoteSpec = 12 + 1
sizeOfFockNoteSpec =... | 31.770492 | 128 | 0.697282 | import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import minimize
from scipy.io import wavfile
from scipy.signal import hilbert
from scipy.special import binom
from mido import MidiFile
import itertools
import nonlin
fockSize = 10
sizeOfNoteSpec = 12 + 1
sizeOfFockNoteSpec = 0
fockOffsets = []
fo... | true | true |
1c419b03436ca7714cc145a58d60b72d08249e0b | 9,376 | py | Python | src/software/parse/testall.py | intel/RAAD | 9cca9e72ff61658191e30756bb260173d5600102 | [
"Intel",
"Apache-2.0"
] | null | null | null | src/software/parse/testall.py | intel/RAAD | 9cca9e72ff61658191e30756bb260173d5600102 | [
"Intel",
"Apache-2.0"
] | null | null | null | src/software/parse/testall.py | intel/RAAD | 9cca9e72ff61658191e30756bb260173d5600102 | [
"Intel",
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# *****************************************************************************/
# * Authors: Joseph Tarango, Randal Eike
# *****************************************************************************/
# @file: testAll.py
# This file is based on testSetup.py from Phuong... | 40.943231 | 159 | 0.620307 | from __future__ import absolute_import, division, print_function, unicode_literals import re, os, sys
from optparse import OptionParser
if not re.search('\.PY$|\.PYC$|\.EXE$', os.path.split(sys.argv[0])[1].upper()):
sys.argv[0] = os.path.join( os.path.split(sys.argv[0])[0] , os.path.split(sys.argv[0])[1]+'.ex... | true | true |
1c419b871f3fff1ebd2e35764f5e998c4986bced | 3,951 | py | Python | importio2/extractor_util.py | import-io/import-io-api-python | 5c838a357742233e714b2ccfd19d25c18531cfa3 | [
"Apache-2.0"
] | 1 | 2021-08-18T03:27:40.000Z | 2021-08-18T03:27:40.000Z | importio2/extractor_util.py | import-io/import-io-api-python | 5c838a357742233e714b2ccfd19d25c18531cfa3 | [
"Apache-2.0"
] | null | null | null | importio2/extractor_util.py | import-io/import-io-api-python | 5c838a357742233e714b2ccfd19d25c18531cfa3 | [
"Apache-2.0"
] | 2 | 2021-09-13T14:28:50.000Z | 2021-09-27T17:56:21.000Z | #
# Copyright 2017 Import.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.273585 | 118 | 0.586434 | import logging
from datetime import datetime
from time import sleep
from importio2 import CrawlRunAPI
from importio2 import ExtractorAPI
logger = logging.getLogger(__name__)
class ExtractorUtilities(object):
def __init__(self):
self.api = ExtractorAPI()
def crawl_run_active(self, extractor_id, craw... | true | true |
1c419baebb28d70b2d3ce8be1c6f2f65b0b07eef | 821 | py | Python | runtests.py | funkybob/django-reformation | 8c6ae3f6091c48ba4079e017663b2c9a15a91b9f | [
"BSD-3-Clause"
] | 1 | 2019-06-27T13:24:08.000Z | 2019-06-27T13:24:08.000Z | runtests.py | funkybob/django-reformation | 8c6ae3f6091c48ba4079e017663b2c9a15a91b9f | [
"BSD-3-Clause"
] | null | null | null | runtests.py | funkybob/django-reformation | 8c6ae3f6091c48ba4079e017663b2c9a15a91b9f | [
"BSD-3-Clause"
] | null | null | null | import os, sys
from django.conf import settings
DIRNAME = os.path.dirname(__file__)
settings.configure(
DEBUG = True,
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(DIRNAME, 'reformation-test.db'),
}
},
INSTALLED_APPS = ('... | 24.878788 | 91 | 0.638246 | import os, sys
from django.conf import settings
DIRNAME = os.path.dirname(__file__)
settings.configure(
DEBUG = True,
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(DIRNAME, 'reformation-test.db'),
}
},
INSTALLED_APPS = ('... | true | true |
1c419db96e522d6532947c03991186fa54405f97 | 7,079 | py | Python | rest_api/simple_supply_rest_api/database.py | elyssa12/education-sawtooth-simple-supply | 52a669db2b30a6a506ceac278378a8161a1c6718 | [
"Apache-2.0"
] | null | null | null | rest_api/simple_supply_rest_api/database.py | elyssa12/education-sawtooth-simple-supply | 52a669db2b30a6a506ceac278378a8161a1c6718 | [
"Apache-2.0"
] | null | null | null | rest_api/simple_supply_rest_api/database.py | elyssa12/education-sawtooth-simple-supply | 52a669db2b30a6a506ceac278378a8161a1c6718 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 34.871921 | 80 | 0.573527 |
import asyncio
import logging
import aiopg
import psycopg2
from psycopg2.extras import RealDictCursor
LATEST_BLOCK_NUM = """
SELECT max(block_num) FROM blocks
"""
LOGGER = logging.getLogger(__name__)
class Database(object):
def __init__(self, host, port, name, user, password, loop):
self._dsn = 'dbnam... | true | true |
1c419de856ffae73049f83b1158780a2791cd626 | 1,129 | py | Python | sherlockpipe/objectinfo/MissionFfiCoordsObjectInfo.py | martindevora/SHERLOCK | 5e7492552cbce29e960684a44fd6ad875c8cf60e | [
"MIT"
] | 1 | 2021-01-14T16:44:48.000Z | 2021-01-14T16:44:48.000Z | sherlockpipe/objectinfo/MissionFfiCoordsObjectInfo.py | martindevora/SHERLOCK | 5e7492552cbce29e960684a44fd6ad875c8cf60e | [
"MIT"
] | null | null | null | sherlockpipe/objectinfo/MissionFfiCoordsObjectInfo.py | martindevora/SHERLOCK | 5e7492552cbce29e960684a44fd6ad875c8cf60e | [
"MIT"
] | null | null | null | from sherlockpipe.objectinfo.ObjectInfo import ObjectInfo
class MissionFfiCoordsObjectInfo(ObjectInfo):
"""
Implementation of ObjectInfo to be used to characterize long-cadence objects from TESS by providing the RA and Dec.
"""
def __init__(self, ra, dec, sectors, initial_mask=None, initial_detrend_per... | 40.321429 | 119 | 0.693534 | from sherlockpipe.objectinfo.ObjectInfo import ObjectInfo
class MissionFfiCoordsObjectInfo(ObjectInfo):
def __init__(self, ra, dec, sectors, initial_mask=None, initial_detrend_period=None):
super().__init__(initial_mask, initial_detrend_period)
self.ra = ra
self.dec = dec
self.secto... | true | true |
1c419f1406e615e605e48a658688ee756341eb09 | 2,316 | py | Python | domintell/messages/dio_status.py | yaccri/python-domintell | e8a17c9f25ef071a58dd0656746bde9105ba5f01 | [
"MIT"
] | 1 | 2021-12-03T04:29:21.000Z | 2021-12-03T04:29:21.000Z | domintell/messages/dio_status.py | yaccri/python-domintell | e8a17c9f25ef071a58dd0656746bde9105ba5f01 | [
"MIT"
] | 3 | 2020-09-20T11:50:28.000Z | 2021-08-13T10:16:14.000Z | domintell/messages/dio_status.py | yaccri/python-domintell | e8a17c9f25ef071a58dd0656746bde9105ba5f01 | [
"MIT"
] | 6 | 2020-10-05T20:23:06.000Z | 2021-09-14T07:18:31.000Z | """
DIO (Input / Output) status (to be inherited)
:author: Zilvinas Binisevicius <zilvinas@binis.me>
"""
import json
import domintell
DIO_COMMAND_CODE = "DIO"
class GenericDIOStatusMessage(domintell.Message):
"""
Generic Digital input & output hybrid module status
"""
def __init__(self, pinCount=1, a... | 26.930233 | 78 | 0.567789 | import json
import domintell
DIO_COMMAND_CODE = "DIO"
class GenericDIOStatusMessage(domintell.Message):
def __init__(self, pinCount=1, address=None):
domintell.Message.__init__(self)
self.moduleType = DIO_COMMAND_CODE
self.pinCount = pinCount
self.serialNumber = None
self.... | true | true |
1c419f420ff290d6c2c95b8df409a0fbd916bfc3 | 221 | py | Python | docs/components_page/components/table/kwargs_source.py | benpgreen/dash-bootstrap-components | 7853b1db5ea39b1eec52ea42fe90db851b509b02 | [
"Apache-2.0"
] | null | null | null | docs/components_page/components/table/kwargs_source.py | benpgreen/dash-bootstrap-components | 7853b1db5ea39b1eec52ea42fe90db851b509b02 | [
"Apache-2.0"
] | null | null | null | docs/components_page/components/table/kwargs_source.py | benpgreen/dash-bootstrap-components | 7853b1db5ea39b1eec52ea42fe90db851b509b02 | [
"Apache-2.0"
] | null | null | null | import dash_bootstrap_components as dbc
from .simple import table as simple_table
table = dbc.Table(
simple_table.children,
bordered=True,
dark=True,
hover=True,
responsive=True,
striped=True,
)
| 17 | 41 | 0.714932 | import dash_bootstrap_components as dbc
from .simple import table as simple_table
table = dbc.Table(
simple_table.children,
bordered=True,
dark=True,
hover=True,
responsive=True,
striped=True,
)
| true | true |
1c41a26f61032f6198f2787aacb6012cc8cd56f6 | 1,800 | py | Python | setup.py | jonathaneunice/combomethod | 554a3ae1c45f156f4bde9b71365ff8fb21c50a13 | [
"Apache-2.0"
] | 1 | 2015-10-12T01:42:11.000Z | 2015-10-12T01:42:11.000Z | setup.py | jonathaneunice/combomethod | 554a3ae1c45f156f4bde9b71365ff8fb21c50a13 | [
"Apache-2.0"
] | null | null | null | setup.py | jonathaneunice/combomethod | 554a3ae1c45f156f4bde9b71365ff8fb21c50a13 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup
from codecs import open
def lines(text):
"""
Returns each non-blank line in text enclosed in a list.
See https://pypi.org/project/textdata for more sophisticated version.
"""
return [l.strip() for l in text.strip().splitlines() if l.strip()]
se... | 35.294118 | 87 | 0.651667 |
from setuptools import setup
from codecs import open
def lines(text):
return [l.strip() for l in text.strip().splitlines() if l.strip()]
setup(
name='combomethod',
version='1.0.12',
author='Jonathan Eunice',
author_email='jonathan.eunice@gmail.com',
description="Decorator indicating a metho... | true | true |
1c41a402ce1ea5d220dd14bb8c5656b8c61a0fd9 | 27,943 | py | Python | reactiondataextractor/extractors/conditions.py | dmw51/reactiondataextractor | f7d2ee9a2a7df17ffcf9b33efee2bcb49dfdcbae | [
"MIT"
] | 3 | 2021-09-29T01:33:35.000Z | 2022-03-19T09:04:23.000Z | reactiondataextractor/extractors/conditions.py | dmw51/reactiondataextractor | f7d2ee9a2a7df17ffcf9b33efee2bcb49dfdcbae | [
"MIT"
] | 4 | 2021-10-05T06:11:28.000Z | 2022-02-23T21:18:32.000Z | reactiondataextractor/extractors/conditions.py | dmw51/reactiondataextractor | f7d2ee9a2a7df17ffcf9b33efee2bcb49dfdcbae | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Conditions
=======
This module contains classes and methods for extracting conditions, as well as directly related functions.
author: Damian Wilary
email: dmw51@cam.ac.uk
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
f... | 46.963025 | 123 | 0.637655 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from collections import Counter
from itertools import chain
import logging
from matplotlib.patches import Rectangle
import numpy as np
import os
import re
from chemdataextractor.doc import Span
from chemdat... | true | true |
1c41a46a988da3d4e057e2e594df382646f14b9c | 24,352 | py | Python | nsl/stac/utils.py | nearspacelabs/stac-client-python | d23eb3d991b97f23ea835bf5f9834a7e86886048 | [
"Apache-2.0"
] | 19 | 2019-12-09T15:04:40.000Z | 2021-12-09T21:46:21.000Z | nsl/stac/utils.py | nearspacelabs/stac-client-python | d23eb3d991b97f23ea835bf5f9834a7e86886048 | [
"Apache-2.0"
] | 16 | 2019-11-25T16:54:11.000Z | 2021-12-16T15:35:40.000Z | nsl/stac/utils.py | nearspacelabs/stac-client-python | d23eb3d991b97f23ea835bf5f9834a7e86886048 | [
"Apache-2.0"
] | 3 | 2019-12-12T08:34:12.000Z | 2021-04-13T22:49:59.000Z | # Copyright 2019-20 Near Space Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 45.348231 | 120 | 0.650583 |
import os
import datetime
import http.client
import re
from urllib.parse import urlparse
from typing import List, Iterator, IO, Union, Dict, Any
import boto3
import botocore
import botocore.exceptions
import botocore.client
from google.cloud import storage
from google.protobuf import timestamp_pb2, duration_pb2
from... | true | true |
1c41a62dff4399c2ae042990b71a295d06bd7539 | 604 | py | Python | setup.py | kablekompany/kable-kogs | 3fa0937281a9610aa4c10d389d1ae30d61d1fd15 | [
"MIT"
] | 18 | 2020-08-25T07:30:22.000Z | 2021-12-19T18:46:41.000Z | setup.py | KingPanda0/kable | 3679029bc8698033d6bc853a64f8470e3a4d9c54 | [
"MIT"
] | 24 | 2020-08-27T06:07:32.000Z | 2021-06-20T18:00:38.000Z | setup.py | KingPanda0/kable | 3679029bc8698033d6bc853a64f8470e3a4d9c54 | [
"MIT"
] | 21 | 2020-08-27T04:33:37.000Z | 2021-12-31T12:33:50.000Z | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="Kable-Kogs",
version="1.0.1",
author="Trent Kable",
author_email="trent@kablekompany.com",
description="Cogs for Kr0nos",
long_description=long_description,
long_description_conten... | 27.454545 | 50 | 0.660596 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="Kable-Kogs",
version="1.0.1",
author="Trent Kable",
author_email="trent@kablekompany.com",
description="Cogs for Kr0nos",
long_description=long_description,
long_description_conten... | true | true |
1c41a9a44ac033df15f98746e9d31323224a73a3 | 2,461 | py | Python | setup.py | miigotu/pymediainfo | 0ec662b0e2f5d34123e65e01c4c3af92acb91825 | [
"MIT"
] | null | null | null | setup.py | miigotu/pymediainfo | 0ec662b0e2f5d34123e65e01c4c3af92acb91825 | [
"MIT"
] | null | null | null | setup.py | miigotu/pymediainfo | 0ec662b0e2f5d34123e65e01c4c3af92acb91825 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
from setuptools import find_packages, setup
with open("README.rst") as f:
long_description = f.read()
data_files = []
bin_files = []
cmdclass = {}
bin_license = 'docs/License.html'
if os.path.exists(bin_license):
data_files.append(('docs', [bin_license]))
bin_files.extend... | 33.712329 | 70 | 0.628606 | import os
from setuptools import find_packages, setup
with open("README.rst") as f:
long_description = f.read()
data_files = []
bin_files = []
cmdclass = {}
bin_license = 'docs/License.html'
if os.path.exists(bin_license):
data_files.append(('docs', [bin_license]))
bin_files.extend(['MediaInfo.dll', 'li... | true | true |
1c41a9d2514c2ce9d2e5fb9a3e6c44b1be4b246f | 1,407 | py | Python | applied_python/applied_python/lib/python2.7/site-packages/pylint/test/functional/redefined_variable_type.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | null | null | null | applied_python/applied_python/lib/python2.7/site-packages/pylint/test/functional/redefined_variable_type.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | 1 | 2016-03-22T13:36:30.000Z | 2016-03-22T13:36:30.000Z | applied_python/applied_python/lib/python2.7/site-packages/pylint/test/functional/redefined_variable_type.py | mith1979/ansible_automation | 013dfa67c6d91720b787fadb21de574b6e023a26 | [
"Apache-2.0"
] | null | null | null | """Checks variable types aren't redefined within a method or a function"""
# pylint: disable=too-few-public-methods, missing-docstring, unused-variable
_OK = True
class MyClass(object):
class Klass(object):
def __init__(self):
self.var2 = 'var'
def __init__(self):
self.var = Tru... | 25.125 | 94 | 0.599147 |
_OK = True
class MyClass(object):
class Klass(object):
def __init__(self):
self.var2 = 'var'
def __init__(self):
self.var = True
self.var1 = 2
self.var2 = 1.
self.var1 = 2. self.a_str = "hello"
a_str = False
(a_str, b_str) = (1, 2... | true | true |
1c41aa776db58a7a73cab29edf0dae007400da3d | 14,366 | py | Python | Workflow_Scripts/hidata4gxp.py | USGS-Astrogeology/APPL-Tools | ee050355251377c512578f15c541929cd52b0acb | [
"Unlicense"
] | null | null | null | Workflow_Scripts/hidata4gxp.py | USGS-Astrogeology/APPL-Tools | ee050355251377c512578f15c541929cd52b0acb | [
"Unlicense"
] | 12 | 2021-05-19T20:59:23.000Z | 2021-07-29T14:45:17.000Z | Workflow_Scripts/hidata4gxp.py | USGS-Astrogeology/APPL-Tools | ee050355251377c512578f15c541929cd52b0acb | [
"Unlicense"
] | 2 | 2022-02-15T17:00:03.000Z | 2022-02-23T00:50:22.000Z | #!/usr/bin/env python
import sys
import os
from os import path
import argparse
import subprocess
from pysis import isis
from pysis.exceptions import ProcessError
import pandas as pd
import numpy as np
from osgeo import gdal, ogr, osr
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import ElementTree
from... | 37.905013 | 137 | 0.626062 | import sys
import os
from os import path
import argparse
import subprocess
from pysis import isis
from pysis.exceptions import ProcessError
import pandas as pd
import numpy as np
from osgeo import gdal, ogr, osr
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import ElementTree
from appl_tools.config imp... | true | true |
1c41ab16d8d7931058760b239bdd280c786fa723 | 1,707 | py | Python | nerodia/locators/text_field/selector_builder.py | harsh183/nerodia | 69c5e4408432e85b5af0b2da03015f729809dac4 | [
"MIT"
] | 83 | 2017-11-20T08:41:09.000Z | 2022-02-09T21:01:47.000Z | nerodia/locators/text_field/selector_builder.py | harsh183/nerodia | 69c5e4408432e85b5af0b2da03015f729809dac4 | [
"MIT"
] | 28 | 2017-11-21T02:25:03.000Z | 2021-04-15T15:26:30.000Z | nerodia/locators/text_field/selector_builder.py | harsh183/nerodia | 69c5e4408432e85b5af0b2da03015f729809dac4 | [
"MIT"
] | 14 | 2017-11-29T06:44:12.000Z | 2021-09-06T04:53:44.000Z | from nerodia.exception import LocatorException
from ..element.selector_builder import SelectorBuilder as ElementSelectorBuilder, \
XPath as ElementXPath
from ..element.xpath_support import XpathSupport
from ...elements.text_field import TextField
class SelectorBuilder(ElementSelectorBuilder):
pass
class XPa... | 32.207547 | 99 | 0.636204 | from nerodia.exception import LocatorException
from ..element.selector_builder import SelectorBuilder as ElementSelectorBuilder, \
XPath as ElementXPath
from ..element.xpath_support import XpathSupport
from ...elements.text_field import TextField
class SelectorBuilder(ElementSelectorBuilder):
pass
class XPa... | true | true |
1c41ab714ae677b4582248ecbcdc9ff139b239e2 | 37 | py | Python | src/py2_em/__init__.py | chrisBrookes93/Py2Em | 92f659a88609a26bcfe02c203d9b8d961e3c24fd | [
"MIT"
] | null | null | null | src/py2_em/__init__.py | chrisBrookes93/Py2Em | 92f659a88609a26bcfe02c203d9b8d961e3c24fd | [
"MIT"
] | null | null | null | src/py2_em/__init__.py | chrisBrookes93/Py2Em | 92f659a88609a26bcfe02c203d9b8d961e3c24fd | [
"MIT"
] | null | null | null | from .py2emulator import Py2Emulator
| 18.5 | 36 | 0.864865 | from .py2emulator import Py2Emulator
| true | true |
1c41abcbd4cac69e273cbc8ae777627a6034afae | 2,521 | py | Python | ee_mapper/map/ee_analysis.py | dgketchum/IrrMapper | 37b692e91e20bc0f34b1fb0116402990510a1e21 | [
"Apache-2.0"
] | 6 | 2018-03-20T21:32:00.000Z | 2020-07-20T16:07:04.000Z | ee_mapper/map/ee_analysis.py | dgketchum/IrrMapper | 37b692e91e20bc0f34b1fb0116402990510a1e21 | [
"Apache-2.0"
] | 9 | 2018-12-22T19:15:28.000Z | 2021-08-25T14:40:15.000Z | ee_mapper/map/ee_analysis.py | dgketchum/IrrMapper | 37b692e91e20bc0f34b1fb0116402990510a1e21 | [
"Apache-2.0"
] | 7 | 2018-03-15T06:08:39.000Z | 2021-04-13T07:52:01.000Z | # ===============================================================================
# Copyright 2018 dgketchum
#
# 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... | 36.536232 | 109 | 0.563269 |
import os
from pprint import pprint
import ee
from map.assets import list_assets
from map.call_ee import is_authorized
ASSET_ROOT = 'users/dgketchum/classy'
STATES = ['AZ', 'CA', 'CO', 'ID', 'MT', 'NM', 'NV', 'OR', 'UT', 'WA', 'WY']
TARGET_STATES = ['OR']
BOUNDARIES = 'users/dgketchum/boundaries'
ASSET_ROOT = 'user... | true | true |
1c41ac8c28e95e2fd967b7b3abf9f6e5e46581e5 | 360 | py | Python | Python/B7-Klatschschalter/02 Klatsch-Schalter.py | frankyhub/Calliope | 335f0ef5ca9bcf57e14166319501ec9086bc09bf | [
"MIT"
] | null | null | null | Python/B7-Klatschschalter/02 Klatsch-Schalter.py | frankyhub/Calliope | 335f0ef5ca9bcf57e14166319501ec9086bc09bf | [
"MIT"
] | null | null | null | Python/B7-Klatschschalter/02 Klatsch-Schalter.py | frankyhub/Calliope | 335f0ef5ca9bcf57e14166319501ec9086bc09bf | [
"MIT"
] | null | null | null | LED = 0
def on_forever():
global LED
if input.sound_level() > 20:
if LED == 1:
LED = 0
if LED == 0:
basic.turn_rgb_led_off()
elif LED == 0:
LED = 1
if LED == 1:
basic.set_led_color(0xff0000)
bas... | 24 | 46 | 0.45 | LED = 0
def on_forever():
global LED
if input.sound_level() > 20:
if LED == 1:
LED = 0
if LED == 0:
basic.turn_rgb_led_off()
elif LED == 0:
LED = 1
if LED == 1:
basic.set_led_color(0xff0000)
bas... | true | true |
1c41ad4f30724a7a81f6d60c2522b7bdc7a72915 | 1,511 | py | Python | qtrio/_tests/examples/test_emissions.py | nodeselector/qtrio | 4bc25ef97d7e6e01a9751de9c84a4214e637e9d4 | [
"Apache-2.0",
"MIT"
] | null | null | null | qtrio/_tests/examples/test_emissions.py | nodeselector/qtrio | 4bc25ef97d7e6e01a9751de9c84a4214e637e9d4 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-03-30T21:14:20.000Z | 2021-03-30T21:14:20.000Z | qtrio/_tests/examples/test_emissions.py | nodeselector/qtrio | 4bc25ef97d7e6e01a9751de9c84a4214e637e9d4 | [
"Apache-2.0",
"MIT"
] | null | null | null | import functools
import typing
import pytestqt.qtbot
import trio
import trio.testing
import qtrio
import qtrio.examples.emissions
async def test_main(
qtbot: pytestqt.qtbot.QtBot,
optional_hold_event: typing.Optional[trio.Event],
) -> None:
async with trio.open_nursery() as nursery:
start = func... | 27.981481 | 79 | 0.612839 | import functools
import typing
import pytestqt.qtbot
import trio
import trio.testing
import qtrio
import qtrio.examples.emissions
async def test_main(
qtbot: pytestqt.qtbot.QtBot,
optional_hold_event: typing.Optional[trio.Event],
) -> None:
async with trio.open_nursery() as nursery:
start = func... | true | true |
1c41ad8a0e57bc585224e96a4a5ca9f78f10405e | 657 | py | Python | manage.py | dongtianyi/xiaomubiao | 0768273515e117dfcbe9c311fa91079599bc40ac | [
"MIT"
] | null | null | null | manage.py | dongtianyi/xiaomubiao | 0768273515e117dfcbe9c311fa91079599bc40ac | [
"MIT"
] | null | null | null | manage.py | dongtianyi/xiaomubiao | 0768273515e117dfcbe9c311fa91079599bc40ac | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'xiaomubiao.settings')
try:
from django.core.management import execute_from_command_line
except I... | 28.565217 | 74 | 0.678843 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'xiaomubiao.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
1c41aed5304b3f0610dbabc70a4fb8f987fe843a | 3,081 | py | Python | pyembed/markdown/test/pattern_test.py | wamonite/pyembed-markdown | 64f9766ff705ee9c0402958cb33aa1e3561e9315 | [
"MIT"
] | 11 | 2015-06-09T20:59:15.000Z | 2021-01-04T09:32:54.000Z | pyembed/markdown/test/pattern_test.py | wamonite/pyembed-markdown | 64f9766ff705ee9c0402958cb33aa1e3561e9315 | [
"MIT"
] | 4 | 2015-12-14T05:10:23.000Z | 2020-02-18T02:24:34.000Z | pyembed/markdown/test/pattern_test.py | wamonite/pyembed-markdown | 64f9766ff705ee9c0402958cb33aa1e3561e9315 | [
"MIT"
] | 3 | 2015-12-21T19:10:55.000Z | 2018-01-02T03:25:15.000Z | # The MIT License(MIT)
# Copyright (c) 2013-2014 Matt Thomson
# 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, mo... | 33.129032 | 79 | 0.733853 |
from pyembed.markdown.pattern import PyEmbedPattern
from mock import patch, Mock
def test_should_match_pyembed_link():
md = Mock()
re = PyEmbedPattern(None, md).getCompiledRegExp()
match = re.match('[!embed](http://www.example.com)')
assert match
def test_should_match_pyembed_link_with_param... | true | true |
1c41af2c668e04c2ab96aaa7cf8b39d914a30ec4 | 12,962 | py | Python | espnet/nets/pytorch_backend/lm/default.py | Hertin/espnet | a0f2175df08b4750a9f0305c20b8c11f6e941867 | [
"Apache-2.0"
] | 3 | 2021-05-27T13:33:37.000Z | 2021-10-06T05:52:20.000Z | espnet/nets/pytorch_backend/lm/default.py | Hertin/espnet | a0f2175df08b4750a9f0305c20b8c11f6e941867 | [
"Apache-2.0"
] | 2 | 2020-10-26T15:22:48.000Z | 2021-01-15T10:17:57.000Z | espnet/nets/pytorch_backend/lm/default.py | Hertin/espnet | a0f2175df08b4750a9f0305c20b8c11f6e941867 | [
"Apache-2.0"
] | 2 | 2021-11-30T07:42:44.000Z | 2021-12-01T07:10:01.000Z | """Default Recurrent Neural Network Languge Model in `lm_train.py`."""
from typing import Any
from typing import List
from typing import Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from espnet.nets.lm_interface import LMInterface
from espnet.nets.pytorch_backend.e2e_asr import to_device
... | 34.565333 | 88 | 0.554004 |
from typing import Any
from typing import List
from typing import Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from espnet.nets.lm_interface import LMInterface
from espnet.nets.pytorch_backend.e2e_asr import to_device
from espnet.nets.scorer_interface import BatchScorerInterface
class D... | true | true |
1c41b07b12f06d5178ee919761cfff1e7f50f924 | 171 | py | Python | Exercícios/ex030.py | JefterV/Cursoemvideo.py | e65ac53a4e38793be3039d360e7127e1c5d51030 | [
"MIT"
] | 3 | 2020-11-24T17:20:34.000Z | 2020-12-03T01:19:31.000Z | Exercícios/ex030.py | JefterV/Cursoemvideo.py | e65ac53a4e38793be3039d360e7127e1c5d51030 | [
"MIT"
] | null | null | null | Exercícios/ex030.py | JefterV/Cursoemvideo.py | e65ac53a4e38793be3039d360e7127e1c5d51030 | [
"MIT"
] | 1 | 2021-01-03T00:48:48.000Z | 2021-01-03T00:48:48.000Z | num = int(input('Digite um numero: '))
resultado = num % 2
if resultado == 0:
print('O numero {} é PAR'.format(num))
else:
print('O numero {} é IMPAR'.format(num)) | 28.5 | 44 | 0.619883 | num = int(input('Digite um numero: '))
resultado = num % 2
if resultado == 0:
print('O numero {} é PAR'.format(num))
else:
print('O numero {} é IMPAR'.format(num)) | true | true |
1c41b0dd46bde5deecd1784f1c58b70fbada87c2 | 30,602 | py | Python | qiskit/providers/aer/backends/qasm_simulator.py | paulineollitrault/qiskit-aer | 7f9ad2ea93698813901b345f7ee6eee8e02ebce9 | [
"Apache-2.0"
] | null | null | null | qiskit/providers/aer/backends/qasm_simulator.py | paulineollitrault/qiskit-aer | 7f9ad2ea93698813901b345f7ee6eee8e02ebce9 | [
"Apache-2.0"
] | null | null | null | qiskit/providers/aer/backends/qasm_simulator.py | paulineollitrault/qiskit-aer | 7f9ad2ea93698813901b345f7ee6eee8e02ebce9 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 43.968391 | 92 | 0.644664 |
import copy
import logging
from warnings import warn
from qiskit.providers.options import Options
from qiskit.providers.models import QasmBackendConfiguration
from ..version import __version__
from ..aererror import AerError
from .aerbackend import AerBackend
from .backend_utils import (cpp_execute, available_methods... | true | true |
1c41b17f7bb836d14623cc4a397356afafd65cf3 | 1,512 | py | Python | haystack/nodes/summarizer/base.py | ArzelaAscoIi/haystack | be8f50c9e3de4e264b3f345f5f4b9c9ec518ed08 | [
"Apache-2.0"
] | 1 | 2022-03-06T02:13:15.000Z | 2022-03-06T02:13:15.000Z | haystack/nodes/summarizer/base.py | ArzelaAscoIi/haystack | be8f50c9e3de4e264b3f345f5f4b9c9ec518ed08 | [
"Apache-2.0"
] | null | null | null | haystack/nodes/summarizer/base.py | ArzelaAscoIi/haystack | be8f50c9e3de4e264b3f345f5f4b9c9ec518ed08 | [
"Apache-2.0"
] | 1 | 2022-03-23T18:17:02.000Z | 2022-03-23T18:17:02.000Z | from typing import List, Dict, Optional
from abc import abstractmethod
from haystack.schema import Document
from haystack.nodes.base import BaseComponent
class BaseSummarizer(BaseComponent):
"""
Abstract class for Summarizer
"""
outgoing_edges = 1
@abstractmethod
def predict(self, document... | 38.769231 | 123 | 0.653439 | from typing import List, Dict, Optional
from abc import abstractmethod
from haystack.schema import Document
from haystack.nodes.base import BaseComponent
class BaseSummarizer(BaseComponent):
outgoing_edges = 1
@abstractmethod
def predict(self, documents: List[Document], generate_single_summary: Option... | true | true |
1c41b19962ca40e88a19220ebf2fcd6921d38be5 | 12,224 | py | Python | chainer/functions/activation/lstm.py | pyotr777/chainer | 8532edbd921ab0ea98c9447957565777e4601662 | [
"MIT"
] | null | null | null | chainer/functions/activation/lstm.py | pyotr777/chainer | 8532edbd921ab0ea98c9447957565777e4601662 | [
"MIT"
] | null | null | null | chainer/functions/activation/lstm.py | pyotr777/chainer | 8532edbd921ab0ea98c9447957565777e4601662 | [
"MIT"
] | null | null | null | import numpy
import six
import chainer
from chainer.backends import cuda
from chainer.backends import intel64
from chainer import function
from chainer import function_node
from chainer.utils import type_check
def _extract_gates(x):
r = x.reshape((len(x), x.shape[1] // 4, 4) + x.shape[2:])
return [r[:, :, i]... | 33.307902 | 79 | 0.558082 | import numpy
import six
import chainer
from chainer.backends import cuda
from chainer.backends import intel64
from chainer import function
from chainer import function_node
from chainer.utils import type_check
def _extract_gates(x):
r = x.reshape((len(x), x.shape[1] // 4, 4) + x.shape[2:])
return [r[:, :, i]... | true | true |
1c41b2b1ff17ba4ae909b0fcd1716087670f269c | 32,333 | py | Python | Integrations/Active_Directory_Query/Active_Directory_Query.py | danikdanik/content | 6749affdb6d3567440ab4d7b60180fdde1486cb3 | [
"MIT"
] | 1 | 2020-08-02T18:00:00.000Z | 2020-08-02T18:00:00.000Z | Integrations/Active_Directory_Query/Active_Directory_Query.py | danikdanik/content | 6749affdb6d3567440ab4d7b60180fdde1486cb3 | [
"MIT"
] | 4 | 2021-03-26T00:33:20.000Z | 2021-12-13T20:48:36.000Z | Integrations/Active_Directory_Query/Active_Directory_Query.py | danikdanik/content | 6749affdb6d3567440ab4d7b60180fdde1486cb3 | [
"MIT"
] | 1 | 2020-07-22T09:09:26.000Z | 2020-07-22T09:09:26.000Z | import demistomock as demisto
from CommonServerPython import *
from ldap3 import Server, Connection, NTLM, SUBTREE, ALL_ATTRIBUTES, Tls
from ldap3.core.exceptions import LDAPSocketOpenError
from ldap3.extend import microsoft
import ssl
from datetime import datetime
# global connection
conn = None
''' GLOBAL VARS '''... | 32.044599 | 120 | 0.638759 | import demistomock as demisto
from CommonServerPython import *
from ldap3 import Server, Connection, NTLM, SUBTREE, ALL_ATTRIBUTES, Tls
from ldap3.core.exceptions import LDAPSocketOpenError
from ldap3.extend import microsoft
import ssl
from datetime import datetime
conn = None
COOMON_ACCOUNT_CONTROL_FLAGS = {
... | true | true |
1c41b2c3fd85c3158634955ff714604086a1bca8 | 854 | py | Python | imageclassifierapp/services/classifier.py | onl1ner/django-image-classifier | 6bb0726fbd61bb60bd245356ca85d7030ced131e | [
"MIT"
] | null | null | null | imageclassifierapp/services/classifier.py | onl1ner/django-image-classifier | 6bb0726fbd61bb60bd245356ca85d7030ced131e | [
"MIT"
] | null | null | null | imageclassifierapp/services/classifier.py | onl1ner/django-image-classifier | 6bb0726fbd61bb60bd245356ca85d7030ced131e | [
"MIT"
] | 1 | 2022-02-26T17:50:12.000Z | 2022-02-26T17:50:12.000Z | import os
import numpy as np
import tensorflow as tf
from PIL import Image
from django.conf import settings
from keras.preprocessing import image
from keras.models import load_model
class Classifier:
IMG_SIZE = (32, 32)
LABELS = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'sh... | 24.4 | 103 | 0.653396 | import os
import numpy as np
import tensorflow as tf
from PIL import Image
from django.conf import settings
from keras.preprocessing import image
from keras.models import load_model
class Classifier:
IMG_SIZE = (32, 32)
LABELS = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'sh... | true | true |
1c41b3489aa516f6ce1d161f96d86415ed8d1718 | 11,407 | py | Python | analyseUsage.py | shenyuanv/powerAnalysis | 8ebd4c9ad79c1bfe7ac13008fe39a74b00d64805 | [
"MIT"
] | null | null | null | analyseUsage.py | shenyuanv/powerAnalysis | 8ebd4c9ad79c1bfe7ac13008fe39a74b00d64805 | [
"MIT"
] | null | null | null | analyseUsage.py | shenyuanv/powerAnalysis | 8ebd4c9ad79c1bfe7ac13008fe39a74b00d64805 | [
"MIT"
] | null | null | null | import sys
import sqlite3
from datetime import datetime
from datetime import timedelta
import numpy as np
import argparse
from collections import namedtuple
def contiguous_regions(condition):
d = np.diff(condition)
idx, = d.nonzero()
idx += 1
if condition[0]:
idx = np.r_[0, idx]
if cond... | 34.152695 | 166 | 0.656877 | import sys
import sqlite3
from datetime import datetime
from datetime import timedelta
import numpy as np
import argparse
from collections import namedtuple
def contiguous_regions(condition):
d = np.diff(condition)
idx, = d.nonzero()
idx += 1
if condition[0]:
idx = np.r_[0, idx]
if cond... | true | true |
1c41b353fc7188837b5aed9c63eaf270d8a72a87 | 962 | py | Python | Python/DFS/med_course_schedule.py | animeshramesh/interview-prep | 882e8bc8b4653a713754ab31a3b08e05505be2bc | [
"Apache-2.0"
] | null | null | null | Python/DFS/med_course_schedule.py | animeshramesh/interview-prep | 882e8bc8b4653a713754ab31a3b08e05505be2bc | [
"Apache-2.0"
] | null | null | null | Python/DFS/med_course_schedule.py | animeshramesh/interview-prep | 882e8bc8b4653a713754ab31a3b08e05505be2bc | [
"Apache-2.0"
] | null | null | null | """
Trick is to keep track of current path.
Time: O(V+E)
Space: O(V+E)
"""
from collections import defaultdict
class Solution:
def dfs_cycle(self, node):
self.visited[node]=True
self.current_path[node]=True
for neighbour in list(self.graph[node]):
if not self.visited[neighbo... | 23.463415 | 57 | 0.582121 |
from collections import defaultdict
class Solution:
def dfs_cycle(self, node):
self.visited[node]=True
self.current_path[node]=True
for neighbour in list(self.graph[node]):
if not self.visited[neighbour]:
if self.dfs_cycle(neighbour):
retur... | true | true |
1c41b5c3a6b112b35c678de3ddff2b80cb09f9b3 | 7,391 | py | Python | codewars/robotic_tatoo_removal.py | davidlukac/codekata-python | e4a9297fa658d2d36de43b3547353be85c08e990 | [
"MIT"
] | null | null | null | codewars/robotic_tatoo_removal.py | davidlukac/codekata-python | e4a9297fa658d2d36de43b3547353be85c08e990 | [
"MIT"
] | null | null | null | codewars/robotic_tatoo_removal.py | davidlukac/codekata-python | e4a9297fa658d2d36de43b3547353be85c08e990 | [
"MIT"
] | null | null | null | # Robotic Tattoo Removal
# http://www.codewars.com/kata/robotic-tattoo-removal
import unittest
from typing import List
def robot(skin_scan: List[List[chr]]) -> List[List[chr]]:
for row_num, row in enumerate(skin_scan):
for val_key, val in enumerate(row):
if val == "X":
skin_sc... | 49.273333 | 99 | 0.111487 |
import unittest
from typing import List
def robot(skin_scan: List[List[chr]]) -> List[List[chr]]:
for row_num, row in enumerate(skin_scan):
for val_key, val in enumerate(row):
if val == "X":
skin_scan[row_num][val_key] = '*'
return skin_scan
def robot_2(skin_scan: List[L... | true | true |
1c41b5c3e1f7c2822909254a498a98b9ade8a129 | 2,083 | py | Python | NLP/UNIMO/src/utils/args.py | zhangyimi/Research | 866f91d9774a38d205d6e9a3b1ee6293748261b3 | [
"Apache-2.0"
] | 1,319 | 2020-02-14T10:42:07.000Z | 2022-03-31T15:42:18.000Z | NLP/UNIMO/src/utils/args.py | green9989/Research | 94519a72e7936c77f62a31709634b72c09aabf74 | [
"Apache-2.0"
] | 192 | 2020-02-14T02:53:34.000Z | 2022-03-31T02:25:48.000Z | NLP/UNIMO/src/utils/args.py | green9989/Research | 94519a72e7936c77f62a31709634b72c09aabf74 | [
"Apache-2.0"
] | 720 | 2020-02-14T02:12:38.000Z | 2022-03-31T12:21:15.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 33.063492 | 81 | 0.647144 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
import argparse
def str2bool(v):
return v.lower() in ("true", "t", "1")
class ArgumentGroup(object):
def __init__(self, parser, title, des):
self._group = parser.add_argu... | true | true |
1c41b6346b45ffe3f201d87ca218fc6252c634a6 | 36,353 | py | Python | HoganPA04.py | MicahHogan/HoganPythonPA04 | 62f3e32acba921aae9795e9a109177aac242311c | [
"Apache-2.0"
] | null | null | null | HoganPA04.py | MicahHogan/HoganPythonPA04 | 62f3e32acba921aae9795e9a109177aac242311c | [
"Apache-2.0"
] | null | null | null | HoganPA04.py | MicahHogan/HoganPythonPA04 | 62f3e32acba921aae9795e9a109177aac242311c | [
"Apache-2.0"
] | null | null | null | #Week 4 Programming Assignment
#North Seattle College, CSC 110
#Author: Micah Hogan
#Email: hogan.micah.j@gmail.com
#Constants
#Initial User Input
name = str(input("Please select a name: "))
print("")
mount = str(input("Please select an animal to ride: "))
print("")
weapon = str(input("Please select a wea... | 97.723118 | 1,178 | 0.706764 |
name = str(input("Please select a name: "))
print("")
mount = str(input("Please select an animal to ride: "))
print("")
weapon = str(input("Please select a weapon: "))
print("")
role = str(input("Please select a role; (Sorcerer), (Brawler), or (Priest): "))
print("")
while not(role == "Sorcerer" or role == ... | true | true |
1c41b672f8df9b9fd7792551d1a2974e70223fa4 | 1,330 | py | Python | tests/test_convert_units.py | timcera/tstoolbox | a32fa399d96082f01b7eedfd6c8893bdb881845c | [
"BSD-3-Clause"
] | 5 | 2016-10-13T18:06:41.000Z | 2021-06-29T19:47:36.000Z | tests/test_convert_units.py | timcera/tstoolbox | a32fa399d96082f01b7eedfd6c8893bdb881845c | [
"BSD-3-Clause"
] | 21 | 2016-04-28T16:48:03.000Z | 2021-12-16T18:07:07.000Z | tests/test_convert_units.py | timcera/tstoolbox | a32fa399d96082f01b7eedfd6c8893bdb881845c | [
"BSD-3-Clause"
] | 3 | 2018-03-21T21:07:52.000Z | 2021-01-22T20:07:49.000Z | # -*- coding: utf-8 -*-
from unittest import TestCase
import pint_pandas
import pytest
from pandas.testing import assert_frame_equal
from tstoolbox import tstoolbox
class TestConvertUnits(TestCase):
@staticmethod
def test_convert_units():
a = tstoolbox.read("tests/data_gainesville_daily_precip.csv"... | 32.439024 | 88 | 0.642857 |
from unittest import TestCase
import pint_pandas
import pytest
from pandas.testing import assert_frame_equal
from tstoolbox import tstoolbox
class TestConvertUnits(TestCase):
@staticmethod
def test_convert_units():
a = tstoolbox.read("tests/data_gainesville_daily_precip.csv", target_units="in")
... | true | true |
1c41b6a02f1c62ace1a896acf571367c51dcd8de | 10,511 | py | Python | kubernetes/test/test_apps_v1beta2_api.py | anemerovsky-essextec/python | 6e40b9169b27c3f1f9422c0f6dd1cd9caef8d57c | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_apps_v1beta2_api.py | anemerovsky-essextec/python | 6e40b9169b27c3f1f9422c0f6dd1cd9caef8d57c | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_apps_v1beta2_api.py | anemerovsky-essextec/python | 6e40b9169b27c3f1f9422c0f6dd1cd9caef8d57c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 19.72045 | 105 | 0.597755 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.apis.apps_v1beta2_api import AppsV1beta2Api
class TestAppsV1beta2Api(unittest.TestCase):
def setUp(self):
self.api = kubernetes.... | true | true |
1c41b7adadfa8fa732c4d2ec2617a5980c1b03cc | 3,783 | py | Python | frappe/desk/page/messages/messages.py | kardmode/frappe | d8f46daa7157545e4d302a2d54c059419d0113f3 | [
"MIT"
] | null | null | null | frappe/desk/page/messages/messages.py | kardmode/frappe | d8f46daa7157545e4d302a2d54c059419d0113f3 | [
"MIT"
] | null | null | null | frappe/desk/page/messages/messages.py | kardmode/frappe | d8f46daa7157545e4d302a2d54c059419d0113f3 | [
"MIT"
] | 5 | 2016-11-12T12:14:58.000Z | 2018-03-21T15:45:45.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.desk.notifications import delete_notification_count_for
from frappe.core.doctype.user.user import STANDARD_USERS
from frappe.utils.user import get_enable... | 32.333333 | 98 | 0.731959 |
from __future__ import unicode_literals
import frappe
from frappe.desk.notifications import delete_notification_count_for
from frappe.core.doctype.user.user import STANDARD_USERS
from frappe.utils.user import get_enabled_system_users
from frappe.utils import cint, get_fullname
@frappe.whitelist()
def get_list(arg=Non... | true | true |
1c41b83e466645e23e02647f5200a2a956032b65 | 1,098 | py | Python | nipype/interfaces/dipy/tests/test_auto_DTI.py | moloney/nipype | a7a9c85c79cb1412ba03406074f83200447ef50b | [
"Apache-2.0"
] | 7 | 2017-02-17T08:54:26.000Z | 2022-03-10T20:57:23.000Z | nipype/interfaces/dipy/tests/test_auto_DTI.py | moloney/nipype | a7a9c85c79cb1412ba03406074f83200447ef50b | [
"Apache-2.0"
] | 1 | 2016-04-25T15:07:09.000Z | 2016-04-25T15:07:09.000Z | nipype/interfaces/dipy/tests/test_auto_DTI.py | moloney/nipype | a7a9c85c79cb1412ba03406074f83200447ef50b | [
"Apache-2.0"
] | 2 | 2017-09-23T16:22:00.000Z | 2019-08-01T14:18:52.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..tensors import DTI
def test_DTI_inputs():
input_map = dict(
b0_thres=dict(usedefault=True, ),
ignore_exception=dict(
deprecated='1.0.0',
nohash=True,
usedefault=... | 28.894737 | 67 | 0.598361 | from __future__ import unicode_literals
from ..tensors import DTI
def test_DTI_inputs():
input_map = dict(
b0_thres=dict(usedefault=True, ),
ignore_exception=dict(
deprecated='1.0.0',
nohash=True,
usedefault=True,
),
in_bval=dict(mandatory=True, ... | true | true |
1c41b978de96a66633f186c828e64a2297200373 | 7,955 | py | Python | src/app/modules/a3dc_interface.py | KatonaLab/Build3D | f1430080d5bee9febfbc83c9b2cb2ebf345037ee | [
"MIT"
] | null | null | null | src/app/modules/a3dc_interface.py | KatonaLab/Build3D | f1430080d5bee9febfbc83c9b2cb2ebf345037ee | [
"MIT"
] | 5 | 2021-03-19T09:28:07.000Z | 2022-03-12T00:09:14.000Z | src/app/modules/a3dc_interface.py | KatonaLab/Build3D | f1430080d5bee9febfbc83c9b2cb2ebf345037ee | [
"MIT"
] | 1 | 2019-12-23T16:44:49.000Z | 2019-12-23T16:44:49.000Z | import time
import collections
from modules.packages.a3dc.ImageClass import ImageClass
from modules.packages.a3dc.segmentation import tag_image
import modules.packages.a3dc.core as core
def tagImage(image):
'''
Function that runs ITK connected components on input image
:param image: nd Arra... | 33.707627 | 194 | 0.674921 | import time
import collections
from modules.packages.a3dc.ImageClass import ImageClass
from modules.packages.a3dc.segmentation import tag_image
import modules.packages.a3dc.core as core
def tagImage(image):
tstart = time.process_time()
logText = '\nRunning connected components on : ' ... | true | true |
1c41ba1d5c8d38fd5e567d508126d7895d87d08b | 8,978 | py | Python | donkeycar/parts/lidar.py | BillyCheung10botics/donkeycar | a3278818367e65250a381e59458b5be13b7d2b7c | [
"MIT"
] | null | null | null | donkeycar/parts/lidar.py | BillyCheung10botics/donkeycar | a3278818367e65250a381e59458b5be13b7d2b7c | [
"MIT"
] | null | null | null | donkeycar/parts/lidar.py | BillyCheung10botics/donkeycar | a3278818367e65250a381e59458b5be13b7d2b7c | [
"MIT"
] | null | null | null | """
Lidar
"""
# requies glob to be installed: "pip3 install glob2"
# requires rplidar to be installed: "pip3 install rplidar"
import time
import math
import pickle
import serial
import numpy as np
from donkeycar.utils import norm_deg, dist, deg2rad, arr_to_img
from PIL import Image, ImageDraw
class RPLidar(object):
... | 33.251852 | 125 | 0.583538 |
import time
import math
import pickle
import serial
import numpy as np
from donkeycar.utils import norm_deg, dist, deg2rad, arr_to_img
from PIL import Image, ImageDraw
class RPLidar(object):
def __init__(self, lower_limit = 0, upper_limit = 360, debug=False):
from rplidar import RPLidar
import gl... | true | true |
1c41ba43a17d398946ed978dc080c422fb4fbbb7 | 11,818 | py | Python | src/models/inception_resnet_v1.py | zixia/python-facenet | d86e0c49a9ce413bef6e58a19a9f723aadcef968 | [
"MIT"
] | 4 | 2018-06-11T03:02:49.000Z | 2018-07-11T07:18:52.000Z | src/models/inception_resnet_v1.py | zixia/python-facenet | d86e0c49a9ce413bef6e58a19a9f723aadcef968 | [
"MIT"
] | null | null | null | src/models/inception_resnet_v1.py | zixia/python-facenet | d86e0c49a9ce413bef6e58a19a9f723aadcef968 | [
"MIT"
] | 2 | 2017-08-31T05:35:36.000Z | 2018-10-11T16:42:15.000Z | # Copyright 2016 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 applicable ... | 46.527559 | 90 | 0.568793 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import tensorflow.contrib.slim as slim
def block35(net, scale=1.0, activation_fn=tf.nn.relu, scope=None, reuse=None):
with tf.variable_scope(scope, 'Block35', [net], reuse=reuse):
... | true | true |
1c41bac1991930d3ffc2130cc34e9dcae42d3d11 | 539 | py | Python | output/models/nist_data/list_pkg/date_time/schema_instance/nistschema_sv_iv_list_date_time_min_length_2_xsd/nistschema_sv_iv_list_date_time_min_length_2.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/list_pkg/date_time/schema_instance/nistschema_sv_iv_list_date_time_min_length_2_xsd/nistschema_sv_iv_list_date_time_min_length_2.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/list_pkg/date_time/schema_instance/nistschema_sv_iv_list_date_time_min_length_2_xsd/nistschema_sv_iv_list_date_time_min_length_2.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import List
from xsdata.models.datatype import XmlDateTime
__NAMESPACE__ = "NISTSchema-SV-IV-list-dateTime-minLength-2-NS"
@dataclass
class NistschemaSvIvListDateTimeMinLength2:
class Meta:
name = "NISTSchema-SV-IV-list-dateTime-minLength-2"
na... | 25.666667 | 67 | 0.679035 | from dataclasses import dataclass, field
from typing import List
from xsdata.models.datatype import XmlDateTime
__NAMESPACE__ = "NISTSchema-SV-IV-list-dateTime-minLength-2-NS"
@dataclass
class NistschemaSvIvListDateTimeMinLength2:
class Meta:
name = "NISTSchema-SV-IV-list-dateTime-minLength-2"
na... | true | true |
1c41bd9504b778ac59180a5355284db104a5351c | 1,723 | py | Python | src/main/resources/pytz/zoneinfo/America/Eirunepe.py | TheEin/swagger-maven-plugin | cf93dce2d5c8d3534f4cf8c612b11e2d2313871b | [
"Apache-2.0"
] | 65 | 2015-11-14T13:46:01.000Z | 2021-08-14T05:54:04.000Z | lib/pytz/zoneinfo/America/Eirunepe.py | tjsavage/polymer-dashboard | 19bc467f1206613f8eec646b6f2bc43cc319ef75 | [
"CNRI-Python",
"Linux-OpenIB"
] | 13 | 2016-03-31T20:00:17.000Z | 2021-08-20T14:52:31.000Z | lib/pytz/zoneinfo/America/Eirunepe.py | tjsavage/polymer-dashboard | 19bc467f1206613f8eec646b6f2bc43cc319ef75 | [
"CNRI-Python",
"Linux-OpenIB"
] | 20 | 2015-03-18T08:41:37.000Z | 2020-12-18T02:58:30.000Z | '''tzinfo timezone information for America/Eirunepe.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Eirunepe(DstTzInfo):
'''America/Eirunepe timezone definition. See datetime.tzinfo for details'''
zone = 'America/Eirunep... | 20.759036 | 79 | 0.597214 | from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Eirunepe(DstTzInfo):
zone = 'America/Eirunepe'
_utc_transition_times = [
d(1,1,1,0,0,0),
d(1914,1,1,4,39,28),
d(1931,10,3,16,0,0),
d(1932,4,1,4,0,0),
d(1932,10,3,5,0,0),
d(193... | true | true |
1c41bea762f109d22971558c3e9a1108e0c44bbd | 419 | py | Python | EM-beamer/image/bessel.py | xfli376/Lecture | 4ee193769df089053726ec6e7792718e30f633a4 | [
"Apache-2.0"
] | null | null | null | EM-beamer/image/bessel.py | xfli376/Lecture | 4ee193769df089053726ec6e7792718e30f633a4 | [
"Apache-2.0"
] | null | null | null | EM-beamer/image/bessel.py | xfli376/Lecture | 4ee193769df089053726ec6e7792718e30f633a4 | [
"Apache-2.0"
] | null | null | null | from scipy import optimize, special
from numpy import *
from matplotlib import pyplot as pb
x = arange(0,20,0.01)
for k in arange(0.5,5.5):
y = special.jv(k,x)
pb.plot(x,y)
f = lambda x: -special.jv(k,x)
x_max = optimize.fminbound(f,0,6)
pb.plot([x_max], [special.jv(k,x_max)],'ro')
pb... | 27.933333 | 66 | 0.644391 | from scipy import optimize, special
from numpy import *
from matplotlib import pyplot as pb
x = arange(0,20,0.01)
for k in arange(0.5,5.5):
y = special.jv(k,x)
pb.plot(x,y)
f = lambda x: -special.jv(k,x)
x_max = optimize.fminbound(f,0,6)
pb.plot([x_max], [special.jv(k,x_max)],'ro')
pb... | true | true |
1c41c0dd3400c46c01883be0652a07078deef3cb | 2,616 | py | Python | pydoc_fork/__main__.py | matthewdeanmartin/pydoc_fork | 174475b15be966f3751d5563b4db0beecc3ab1f9 | [
"MIT"
] | null | null | null | pydoc_fork/__main__.py | matthewdeanmartin/pydoc_fork | 174475b15be966f3751d5563b4db0beecc3ab1f9 | [
"MIT"
] | 1 | 2022-01-17T16:28:45.000Z | 2022-01-17T16:28:45.000Z | pydoc_fork/__main__.py | matthewdeanmartin/pydoc_fork | 174475b15be966f3751d5563b4db0beecc3ab1f9 | [
"MIT"
] | null | null | null | # noinspection PyPep8
"""pydoc_fork
A fork of pydoc that is optimized for generating html documentation in a CI context
Usage:
pydoc_fork <package>... [options]
pydoc_fork (-h | --help)
pydoc_fork --version
Options:
-h --help Show this screen.
-v --version Show version.
... | 31.518072 | 86 | 0.64526 |
import logging
import sys
import docopt
from pydoc_fork import commands, settings
from pydoc_fork.settings import load_config
LOGGER = logging.getLogger(__name__)
LOGGERS = []
__version__ = "3.0.0"
def main() -> int:
arguments = docopt.docopt(__doc__, version=f"pydoc_fork {__version__}")
config_path = ... | true | true |
1c41c120c75f8f421df964a15f8054a414382c3e | 608 | py | Python | tests/test_cross_validation.py | ezietsman/lightfm | 59303f4436fc31adc569a277b94b07e4509a6ab2 | [
"Apache-2.0"
] | null | null | null | tests/test_cross_validation.py | ezietsman/lightfm | 59303f4436fc31adc569a277b94b07e4509a6ab2 | [
"Apache-2.0"
] | null | null | null | tests/test_cross_validation.py | ezietsman/lightfm | 59303f4436fc31adc569a277b94b07e4509a6ab2 | [
"Apache-2.0"
] | 1 | 2020-10-07T01:29:32.000Z | 2020-10-07T01:29:32.000Z | import pytest
from lightfm.cross_validation import random_train_test_split
from lightfm.datasets import fetch_movielens
def _assert_disjoint(x, y):
x = x.tocsr()
y = y.tocoo()
for (i, j) in zip(y.row, y.col):
assert x[i, j] == 0.0
@pytest.mark.parametrize('test_percentage',
... | 23.384615 | 80 | 0.682566 | import pytest
from lightfm.cross_validation import random_train_test_split
from lightfm.datasets import fetch_movielens
def _assert_disjoint(x, y):
x = x.tocsr()
y = y.tocoo()
for (i, j) in zip(y.row, y.col):
assert x[i, j] == 0.0
@pytest.mark.parametrize('test_percentage',
... | true | true |
1c41c1db6305da2a3a38f35d262b4e376d92fd5d | 3,935 | py | Python | lib/pathfinding.py | Dogeek/codevo | 690d161b4099d37597246f1ca3164f60a350e662 | [
"MIT"
] | null | null | null | lib/pathfinding.py | Dogeek/codevo | 690d161b4099d37597246f1ca3164f60a350e662 | [
"MIT"
] | null | null | null | lib/pathfinding.py | Dogeek/codevo | 690d161b4099d37597246f1ca3164f60a350e662 | [
"MIT"
] | null | null | null | import collections
import heapq
#http://www.redblobgames.com/pathfinding/a-star/implementation.html
class PriorityQueue:
def __init__(self):
self.elements = []
def empty(self):
return len(self.elements) == 0
def put(self, item, priority):
heapq.heappush(self.elements, (pr... | 26.587838 | 71 | 0.574333 | import collections
import heapq
class PriorityQueue:
def __init__(self):
self.elements = []
def empty(self):
return len(self.elements) == 0
def put(self, item, priority):
heapq.heappush(self.elements, (priority, item))
def get(self):
return heapq.heappop(... | true | true |
1c41c2313befada08cc1f3c0337c864c6f92a845 | 296 | py | Python | MergeQuerySet/Query/models.py | FalseG0d/AdvancedDjango | 52715ffea132e591f98f94b781960fc12a8613e4 | [
"MIT"
] | 9 | 2020-10-17T14:03:35.000Z | 2022-01-12T17:51:14.000Z | MergeQuerySet/Query/models.py | bharathjinka09/AdvancedDjango | f06e1a0621e182ea6015b06e79eae99ddb04affb | [
"MIT"
] | null | null | null | MergeQuerySet/Query/models.py | bharathjinka09/AdvancedDjango | f06e1a0621e182ea6015b06e79eae99ddb04affb | [
"MIT"
] | 4 | 2020-10-20T06:52:26.000Z | 2022-01-07T23:51:59.000Z | from django.db import models
# Create your models here.
class Employee(models.Model):
name=models.CharField(max_length=20)
age=models.IntegerField(max_length=20)
dept=models.CharField(max_length=20)
exp_score=models.IntegerField()
def __str__(self):
return self.name | 26.909091 | 42 | 0.736486 | from django.db import models
class Employee(models.Model):
name=models.CharField(max_length=20)
age=models.IntegerField(max_length=20)
dept=models.CharField(max_length=20)
exp_score=models.IntegerField()
def __str__(self):
return self.name | true | true |
1c41c2d37e53d00e0314729750dcfaf1d5b000f1 | 2,175 | py | Python | test/sagemaker_tests/tensorflow/tensorflow2_training/integration/sagemaker/test_tuning_model_dir.py | Elizaaaaa/deep-learning-containers | 6274ecb264645070d11b27e5c7e60d2e4110537d | [
"Apache-2.0"
] | 1 | 2021-07-14T20:13:12.000Z | 2021-07-14T20:13:12.000Z | test/sagemaker_tests/tensorflow/tensorflow2_training/integration/sagemaker/test_tuning_model_dir.py | Elizaaaaa/deep-learning-containers | 6274ecb264645070d11b27e5c7e60d2e4110537d | [
"Apache-2.0"
] | null | null | null | test/sagemaker_tests/tensorflow/tensorflow2_training/integration/sagemaker/test_tuning_model_dir.py | Elizaaaaa/deep-learning-containers | 6274ecb264645070d11b27e5c7e60d2e4110537d | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 43.5 | 106 | 0.652874 | from __future__ import absolute_import
import os
import pytest
from sagemaker.tensorflow import TensorFlow
from sagemaker.tuner import HyperparameterTuner, IntegerParameter
from ...integration.utils import processor, py_version, unique_name_from_base
@pytest.mark.integration("hpo")
@pytest.mark.model("N/A")
def ... | true | true |
1c41c39880779cec8cbf1aca7a5a8ae07a48c33f | 1,797 | py | Python | dominio/dao.py | MinisterioPublicoRJ/api-cadg | a8998c4c234a65192f1dca8ea9a17a1d4a496556 | [
"MIT"
] | 6 | 2020-02-11T18:45:58.000Z | 2020-05-26T12:37:28.000Z | dominio/dao.py | MinisterioPublicoRJ/api-cadg | a8998c4c234a65192f1dca8ea9a17a1d4a496556 | [
"MIT"
] | 120 | 2019-07-01T14:45:32.000Z | 2022-01-25T19:10:16.000Z | dominio/dao.py | MinisterioPublicoRJ/apimpmapas | 196ad25a4922448b8ae7a66012a2843c7b7194ad | [
"MIT"
] | null | null | null | from dominio.db_connectors import execute as impala_execute
from dominio.exceptions import APIEmptyResultError
class GenericDAO:
"""Classe que implementa métodos genéricos de execução de query no
impala a partir de um arquivo, e posterior serialização.
Atributos:
- QUERIES_DIR (path): Caminho da past... | 30.457627 | 77 | 0.676683 | from dominio.db_connectors import execute as impala_execute
from dominio.exceptions import APIEmptyResultError
class GenericDAO:
QUERIES_DIR = ""
query_file = ""
columns = []
serializer = None
table_namespaces = {}
@classmethod
def query(cls):
with open(cls.QUERIES_DIR.child(cls.... | true | true |
1c41c4e8eedb6f685d8668a37578173dbb3c3525 | 4,707 | py | Python | xlsxwriter/test/worksheet/test_sparkline10.py | yxwlr995/-Python-Pandas-XlsxWriter | cd28c1b968795b67f3013c49a0e02ffda5898163 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/worksheet/test_sparkline10.py | yxwlr995/-Python-Pandas-XlsxWriter | cd28c1b968795b67f3013c49a0e02ffda5898163 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/worksheet/test_sparkline10.py | yxwlr995/-Python-Pandas-XlsxWriter | cd28c1b968795b67f3013c49a0e02ffda5898163 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-04-12T16:44:58.000Z | 2020-04-12T16:44:58.000Z | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
from ..compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
class TestAssembleW... | 42.026786 | 337 | 0.4215 |
import unittest
from ..compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
class TestAssembleWorksheet(unittest.TestCase):
def test_assemble_xml_file(self):
self.maxDiff = None
fh = StringIO()
worksheet = Worksheet()
workshe... | true | true |
1c41c619c9ab1c1348ec5a6a9f77ef5b1fa70dda | 2,439 | py | Python | oblique/nxutils.py | blais/oblique | 8cf9932b20b9d82a29f072d7c69c746e4643a77c | [
"Apache-2.0"
] | 1 | 2020-06-20T13:41:29.000Z | 2020-06-20T13:41:29.000Z | oblique/nxutils.py | blais/oblique | 8cf9932b20b9d82a29f072d7c69c746e4643a77c | [
"Apache-2.0"
] | null | null | null | oblique/nxutils.py | blais/oblique | 8cf9932b20b9d82a29f072d7c69c746e4643a77c | [
"Apache-2.0"
] | null | null | null | """Test program for rendering of a NetworkX graph of the databased."""
import argparse
import collections
import random
import time
import webbrowser
from typing import Text
import colour
import networkx as nx
from oblique import extmodule
_COLORS = """
aliceblue antiquewhite aqua aquamarine azure beige bisque bla... | 39.33871 | 96 | 0.812218 |
import argparse
import collections
import random
import time
import webbrowser
from typing import Text
import colour
import networkx as nx
from oblique import extmodule
_COLORS = """
aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond
blue blueviolet brown burlywood cadetblue chartreuse ... | true | true |
1c41c738875cce571738f3457940bf419e33844e | 1,328 | py | Python | src/constant.py | zeabusTeam/zeabus_vision | bc58872ae4f02656bc153f32968e61a8f3d7cf15 | [
"MIT"
] | 1 | 2019-05-28T12:59:21.000Z | 2019-05-28T12:59:21.000Z | src/constant.py | zeabusTeam/zeabus_vision | bc58872ae4f02656bc153f32968e61a8f3d7cf15 | [
"MIT"
] | 2 | 2019-04-30T11:35:10.000Z | 2019-10-22T10:00:18.000Z | src/constant.py | zeabusTeam/zeabus_vision | bc58872ae4f02656bc153f32968e61a8f3d7cf15 | [
"MIT"
] | null | null | null | """
File name: ansi_color_code.py
Maintainer: AyumiizZ
Python Version: 2.7
About: ansi code for printing color text
"""
class AnsiCode:
"""
Class name: AnsiCode
Maintainer: AyumiizZ
About: ansi code for printing color text
"""
DEFAULT = '\033[0m'
BOLD = '\033[1m'
LIGHT ... | 24.145455 | 44 | 0.568524 |
class AnsiCode:
DEFAULT = '\033[0m'
BOLD = '\033[1m'
LIGHT = '\033[2m'
ITALIC = '\033[3m'
UNDERLINE = '\033[4m'
HL = '\033[7m'
INVISIBLE = '\033[8m'
CROSS = '\033[9m'
BLACK = '\033[30m'
LIGHT_RED = '\033[31m'
LIGHT_GREEN = '\033[32m'
LIGHT_YELLOW = '\033[33m'
LIGHT_... | true | true |
1c41c96b4fb065a49ecc4b698ded32cd58c99a42 | 94 | py | Python | demo/__init__.py | JiangFeng07/NLPIK | bacd52e24690e8ba706895b54a076ee05d785d7b | [
"Apache-2.0"
] | null | null | null | demo/__init__.py | JiangFeng07/NLPIK | bacd52e24690e8ba706895b54a076ee05d785d7b | [
"Apache-2.0"
] | null | null | null | demo/__init__.py | JiangFeng07/NLPIK | bacd52e24690e8ba706895b54a076ee05d785d7b | [
"Apache-2.0"
] | null | null | null | #!/usr/local/bin/ python3
# -*- coding: utf-8 -*-
# @Time : 2022-03-14 13:58
# @Author : Leo | 23.5 | 27 | 0.56383 | true | true | |
1c41c991a06c33be3766ae390ff2eb872ce7d1f6 | 7,875 | py | Python | tensorflow/python/keras/layers/pooling_test.py | alvinlin-pn/tensorflow | c9cd1784bf287543d89593ca1432170cdbf694de | [
"Apache-2.0"
] | 2 | 2021-10-10T23:52:17.000Z | 2022-01-22T00:24:39.000Z | tensorflow/python/keras/layers/pooling_test.py | alvinlin-pn/tensorflow | c9cd1784bf287543d89593ca1432170cdbf694de | [
"Apache-2.0"
] | null | null | null | tensorflow/python/keras/layers/pooling_test.py | alvinlin-pn/tensorflow | c9cd1784bf287543d89593ca1432170cdbf694de | [
"Apache-2.0"
] | 1 | 2020-06-07T22:42:37.000Z | 2020-06-07T22:42:37.000Z | # Copyright 2016 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... | 35.472973 | 80 | 0.629968 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python import keras
from tensorflow.python.eager import context
from tensorflow.python.framework import test_util as tf_test_util
from tensorflow.python.keras import testing... | true | true |
1c41c9d5321b033ba8af5cef0b26ef8e0efec614 | 273 | py | Python | tpc-ds/load_db.py | ambient-docker/ora2postgres | bde236f1cfed625cff718378bfaeea2f07e889f0 | [
"MIT"
] | 2 | 2018-12-03T07:53:44.000Z | 2018-12-03T07:54:15.000Z | tpc-ds/load_db.py | ambient-docker/ora2postgres | bde236f1cfed625cff718378bfaeea2f07e889f0 | [
"MIT"
] | 1 | 2018-12-02T07:36:41.000Z | 2018-12-02T07:36:41.000Z | tpc-ds/load_db.py | ambient-docker/ora2postgres | bde236f1cfed625cff718378bfaeea2f07e889f0 | [
"MIT"
] | 15 | 2018-12-03T07:54:59.000Z | 2019-06-12T13:53:40.000Z | #! /usr/bin/python3
import glob, os
for file in glob.glob("*.ctl"):
if file == "dbgen_version.ctl" :
pass
else:
logfile = file.replace(".ctl",".log")
cmd = 'sqlldr userid=tpcds/p4ssw0rd control={} log={}'.format(file,logfile)
os.system(cmd)
| 22.75 | 80 | 0.604396 |
import glob, os
for file in glob.glob("*.ctl"):
if file == "dbgen_version.ctl" :
pass
else:
logfile = file.replace(".ctl",".log")
cmd = 'sqlldr userid=tpcds/p4ssw0rd control={} log={}'.format(file,logfile)
os.system(cmd)
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.