hexsha
stringlengths
40
40
size
int64
2
1.02M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
โŒ€
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
โŒ€
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
โŒ€
max_issues_repo_path
stringlengths
4
245
max_issues_repo_name
stringlengths
6
130
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
โŒ€
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
โŒ€
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
โŒ€
max_forks_repo_path
stringlengths
4
245
max_forks_repo_name
stringlengths
6
130
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
โŒ€
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
โŒ€
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
โŒ€
content
stringlengths
2
1.02M
avg_line_length
float64
1
958k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
2 classes
is_sharp_comment_removed
bool
1 class
1c384f35d72b0cdb3ecdc5e040b85c709490a00d
3,271
py
Python
python/pyarrow/tests/test_misc.py
tanyaschlusser/arrow
77c6cd3237a2b305cf9c086cbf8d0a49be016701
[ "Apache-2.0", "CC0-1.0" ]
1
2021-01-28T17:30:06.000Z
2021-01-28T17:30:06.000Z
python/pyarrow/tests/test_misc.py
ivanyu/arrow
5d1934fc3f5c65f70a3966b71c68941b2fd8d362
[ "Apache-2.0", "CC0-1.0" ]
null
null
null
python/pyarrow/tests/test_misc.py
ivanyu/arrow
5d1934fc3f5c65f70a3966b71c68941b2fd8d362
[ "Apache-2.0", "CC0-1.0" ]
null
null
null
# 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...
25.161538
72
0.690614
import os import pytest import pyarrow as pa def test_get_include(): include_dir = pa.get_include() assert os.path.exists(os.path.join(include_dir, 'arrow', 'api.h')) @pytest.mark.skipif('sys.platform != "win32"') def test_get_library_dirs_win32(): library_dirs = pa.get_library_dirs() ...
true
true
1c3851b3d43779cdb1f4c93db026666f01001b41
111
py
Python
tiingo_prices/__init__.py
robren/tiingo_prices
3e7f45728b0c5a4a4e60f552b2fda97aa8340a20
[ "MIT" ]
null
null
null
tiingo_prices/__init__.py
robren/tiingo_prices
3e7f45728b0c5a4a4e60f552b2fda97aa8340a20
[ "MIT" ]
1
2020-08-11T18:16:20.000Z
2020-08-11T18:16:20.000Z
tiingo_prices/__init__.py
robren/tiingo_prices
3e7f45728b0c5a4a4e60f552b2fda97aa8340a20
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- __author__ = """Robert Rennison""" __email__ = 'rob@robren.net' __version__ = '0.3.1'
18.5
34
0.621622
__author__ = """Robert Rennison""" __email__ = 'rob@robren.net' __version__ = '0.3.1'
true
true
1c38532383da6d8d572acc687d189e7ed6fd9a0d
3,795
py
Python
snake/base/map.py
AuthurExcalbern/AI-Snake
5dee76fcecd40add58a432ca8b88880b00ac45b9
[ "MIT" ]
null
null
null
snake/base/map.py
AuthurExcalbern/AI-Snake
5dee76fcecd40add58a432ca8b88880b00ac45b9
[ "MIT" ]
1
2018-03-24T08:50:32.000Z
2018-03-28T11:11:50.000Z
snake/base/map.py
AuthurExcalbern/AI-Snake
5dee76fcecd40add58a432ca8b88880b00ac45b9
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # pylint: disable=C0103,C0111,W0201,W0212 """Definition of class Map.""" import random from snake.base.point import Point, PointType from snake.base.pos import Pos class Map: """2D game map.""" def __init__(self, num_rows, num_cols): """Initialize a M...
30.853659
85
0.560474
import random from snake.base.point import Point, PointType from snake.base.pos import Pos class Map: def __init__(self, num_rows, num_cols): if not isinstance(num_rows, int) or not isinstance(num_cols, int): raise TypeError("\'num_rows\' and \'num_cols\' must be integers") if n...
true
true
1c385327f6e8f54f165abb2360d61facae4ffb2f
2,063
py
Python
tasks/UDEMY/100_days/L003/day-3-1.py
AleksNeStu/projects
1a4c68dfbdcb77228f0f3617e58fd18fcb1f5dbb
[ "Apache-2.0" ]
2
2022-01-19T18:01:35.000Z
2022-02-06T06:54:38.000Z
tasks/UDEMY/100_days/L003/day-3-1.py
AleksNeStu/projects
1a4c68dfbdcb77228f0f3617e58fd18fcb1f5dbb
[ "Apache-2.0" ]
null
null
null
tasks/UDEMY/100_days/L003/day-3-1.py
AleksNeStu/projects
1a4c68dfbdcb77228f0f3617e58fd18fcb1f5dbb
[ "Apache-2.0" ]
null
null
null
# ๐Ÿšจ Don't change the code below ๐Ÿ‘‡ number = int(input("Which number do you want to check? ")) # ๐Ÿšจ Don't change the code above ๐Ÿ‘† print("This is an even number." if number % 2 == 0 else "This is an odd number.") #First *fork* your copy. Then copy-paste your code below this line ๐Ÿ‘‡ #Finally click "Run" to execute...
21.05102
122
0.663112
number = int(input("Which number do you want to check? ")) # ๐Ÿšจ Don't change the code above ๐Ÿ‘† print("This is an even number." if number % 2 == 0 else "This is an odd number.") t_func():\n') with open('day-3-1.py', 'r') as original: f2 = original.readlines()[0:40] for x in f2: ...
true
true
1c3854a737ecb7b13cdce6d01922540741c2e1c5
8,734
py
Python
train.py
Moses7D/Keras-YOLOv3
6a2e0bdd921068e0b77106b83c25c24794877907
[ "MIT" ]
null
null
null
train.py
Moses7D/Keras-YOLOv3
6a2e0bdd921068e0b77106b83c25c24794877907
[ "MIT" ]
null
null
null
train.py
Moses7D/Keras-YOLOv3
6a2e0bdd921068e0b77106b83c25c24794877907
[ "MIT" ]
null
null
null
""" Retrain the YOLO model for your own dataset. """ import numpy as np import keras.backend as K from keras.layers import Input, Lambda from keras.models import Model from keras.optimizers import Adam from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping from yolo3.model import p...
43.452736
129
0.680788
""" Retrain the YOLO model for your own dataset. """ import numpy as np import keras.backend as K from keras.layers import Input, Lambda from keras.models import Model from keras.optimizers import Adam from keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStopping from yolo3.model import p...
false
true
1c3854aecee3c4aeeb666f82155b1d9948d1b537
13,148
py
Python
maskrcnn_benchmark-dota/modeling/rpn/rfcos/smallerRF_wo_clsloss.py
RSIA-LIESMARS-WHU/AxisLearning
5a108860c959a200811f9643d567ca7883c74875
[ "BSD-2-Clause" ]
3
2021-01-26T07:03:26.000Z
2021-02-03T12:14:05.000Z
maskrcnn_benchmark/modeling/rpn/rfcos/smallerRF_wo_clsloss.py
RSIA-LIESMARS-WHU/AxisLearning
5a108860c959a200811f9643d567ca7883c74875
[ "BSD-2-Clause" ]
null
null
null
maskrcnn_benchmark/modeling/rpn/rfcos/smallerRF_wo_clsloss.py
RSIA-LIESMARS-WHU/AxisLearning
5a108860c959a200811f9643d567ca7883c74875
[ "BSD-2-Clause" ]
null
null
null
""" This file contains specific functions for computing losses of FCOS file """ import torch from torch.nn import functional as F from torch import nn from ..utils import concat_box_prediction_layers from maskrcnn_benchmark.layers import IOULoss from maskrcnn_benchmark.layers import SigmoidFocalLoss, smooth_l1_loss f...
40.580247
189
0.599255
import torch from torch.nn import functional as F from torch import nn from ..utils import concat_box_prediction_layers from maskrcnn_benchmark.layers import IOULoss from maskrcnn_benchmark.layers import SigmoidFocalLoss, smooth_l1_loss from maskrcnn_benchmark.modeling.matcher import Matcher from maskrcnn_benchmark.m...
true
true
1c385522dc3ad879da84161cb05818f4cd356848
8,193
py
Python
powerline_shell/colortrans.py
vivekkrish/powerline-shell
ad27ed4ccc28f314d7985776b8e8663a33a67102
[ "MIT" ]
2,656
2017-11-28T05:11:53.000Z
2022-03-31T14:10:18.000Z
powerline_shell/colortrans.py
vivekkrish/powerline-shell
ad27ed4ccc28f314d7985776b8e8663a33a67102
[ "MIT" ]
193
2017-11-28T23:20:17.000Z
2022-03-25T12:57:55.000Z
powerline_shell/colortrans.py
vivekkrish/powerline-shell
ad27ed4ccc28f314d7985776b8e8663a33a67102
[ "MIT" ]
387
2017-11-29T22:33:39.000Z
2022-03-31T18:24:35.000Z
#! /usr/bin/env python """ Code is modified (fairly heavily) by hryanjones@gmail.com from https://gist.github.com/MicahElliott/719710 Convert values between RGB tuples and xterm-256 color codes. Nice long listing of all 256 colors and their codes. Useful for developing console color themes, or even script output sch...
25.683386
84
0.45368
__author__ = 'Micah Elliott http://MicahElliott.com' __version__ = '0.1' __copyright__ = 'Copyright (C) 2011 Micah Elliott. All rights reserved.' __license__ = 'WTFPL http://sam.zoy.org/wtfpl/' def hexstr2num(hexstr): return int(hexstr, 16) def rgbstring2tuple(s): return tuple([hexstr2num(h) for...
true
true
1c38553cfee6e8a970919d085bb6fbe062063cc1
773
py
Python
src/qgis_ros/core/translators/json_transport.py
acfrmarine/qgis_ros
01dd107f963b87df063bf2f11b0a484f4323cae9
[ "MIT" ]
31
2018-09-11T17:50:17.000Z
2021-09-13T11:48:47.000Z
src/qgis_ros/core/translators/json_transport.py
acfrmarine/qgis_ros
01dd107f963b87df063bf2f11b0a484f4323cae9
[ "MIT" ]
9
2018-09-11T00:45:23.000Z
2022-01-07T13:19:20.000Z
src/qgis_ros/core/translators/json_transport.py
acfrmarine/qgis_ros
01dd107f963b87df063bf2f11b0a484f4323cae9
[ "MIT" ]
9
2018-10-12T12:31:38.000Z
2021-06-05T02:52:44.000Z
import json_transport from .translator import Translator, VectorTranslatorMixin class JSONTransportTranslator(Translator, VectorTranslatorMixin): messageType = json_transport.PackedJson # geomType = Translator.GeomTypes.Unknown # Need to detect this from the first message. geomType = Translator.GeomTyp...
30.92
92
0.683053
import json_transport from .translator import Translator, VectorTranslatorMixin class JSONTransportTranslator(Translator, VectorTranslatorMixin): messageType = json_transport.PackedJson @staticmethod def translate(msg): msg = msg.data if isinstance(msg, list): ...
true
true
1c3855af57ee7989c4d5d05a2f3435cc8c8f1ddf
16,700
py
Python
unicorn_binance_websocket_api/restclient.py
HrTran/unicorn-binance-websocket-api
64da01868a8c251a486993b868f0de5083922d64
[ "MIT" ]
null
null
null
unicorn_binance_websocket_api/restclient.py
HrTran/unicorn-binance-websocket-api
64da01868a8c251a486993b868f0de5083922d64
[ "MIT" ]
null
null
null
unicorn_binance_websocket_api/restclient.py
HrTran/unicorn-binance-websocket-api
64da01868a8c251a486993b868f0de5083922d64
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: unicorn_binance_websocket_api/restclient.py # # Part of โ€˜UNICORN Binance WebSocket APIโ€™ # Project website: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api # Documentation: https://lucit-systems-and-development.github.io/unicorn-bina...
46.648045
130
0.614731
import json import logging import requests import socket import threading import time logger = logging.getLogger(__name__) class BinanceWebSocketApiRestclient(object): def __init__(self, manager): self.manager = manager self.api_key = False self.api_secre...
true
true
1c38572ef8d952a91c39c221f8b1ab75118fae3b
536
py
Python
helloWorldApp/app/__init__.py
OscarPalominoC/cursoFlask
8f87b8165a45c1c0124184e9866a505def463e44
[ "MIT" ]
null
null
null
helloWorldApp/app/__init__.py
OscarPalominoC/cursoFlask
8f87b8165a45c1c0124184e9866a505def463e44
[ "MIT" ]
null
null
null
helloWorldApp/app/__init__.py
OscarPalominoC/cursoFlask
8f87b8165a45c1c0124184e9866a505def463e44
[ "MIT" ]
null
null
null
from flask import Flask from flask_bootstrap import Bootstrap from flask_login import LoginManager from .config import Config from .auth import auth from .models import UserModel login_manager = LoginManager() login_manager.login_view = 'auth.login' @login_manager.user_loader def load_user(username): return User...
20.615385
39
0.774254
from flask import Flask from flask_bootstrap import Bootstrap from flask_login import LoginManager from .config import Config from .auth import auth from .models import UserModel login_manager = LoginManager() login_manager.login_view = 'auth.login' @login_manager.user_loader def load_user(username): return User...
true
true
1c385763e55768956dcf5c96c892d9d54ca34977
31,252
py
Python
libqtile/backend/wayland/window.py
flexagoon/qtile
ecf79a91da058dc9f8dd032a42e13eac9c2a270d
[ "MIT" ]
null
null
null
libqtile/backend/wayland/window.py
flexagoon/qtile
ecf79a91da058dc9f8dd032a42e13eac9c2a270d
[ "MIT" ]
null
null
null
libqtile/backend/wayland/window.py
flexagoon/qtile
ecf79a91da058dc9f8dd032a42e13eac9c2a270d
[ "MIT" ]
null
null
null
# Copyright (c) 2021 Matt Colligan # # 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...
34.043573
97
0.615001
from __future__ import annotations import functools import typing import cairocffi import pywayland from wlroots import ffi from wlroots.util.edges import Edges from wlroots.wlr_types import Box, Texture from wlroots.wlr_types.layer_shell_v1 import LayerSurfaceV1 from wlroots.wlr_types.xdg_shell i...
true
true
1c38577e134f72b07ab4abb9295e13d7a7e60dc3
561
py
Python
apps/lasso/script/kill.py
daiwei89/wdai_petuum_public
4068859897061201d0a63630a3da6011b0d0f75f
[ "BSD-3-Clause" ]
null
null
null
apps/lasso/script/kill.py
daiwei89/wdai_petuum_public
4068859897061201d0a63630a3da6011b0d0f75f
[ "BSD-3-Clause" ]
null
null
null
apps/lasso/script/kill.py
daiwei89/wdai_petuum_public
4068859897061201d0a63630a3da6011b0d0f75f
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python import os, sys from os.path import dirname from os.path import join if len(sys.argv) != 2: print "usage: ./kill.py <hostfile>" sys.exit(1) hostfile = sys.argv[1] # Get host IPs with open(hostfile, "r") as f: hostlines = f.read().splitlines() host_ips = [line.split()[1] for line in hostli...
19.344828
50
0.652406
import os, sys from os.path import dirname from os.path import join if len(sys.argv) != 2: print "usage: ./kill.py <hostfile>" sys.exit(1) hostfile = sys.argv[1] with open(hostfile, "r") as f: hostlines = f.read().splitlines() host_ips = [line.split()[1] for line in hostlines] ssh_cmd = ( "ssh " "-...
false
true
1c3857f5ef43f46f8e2416b7d4d3c2c0e9b2c929
3,596
py
Python
ec2instanceconnectcli/mops.py
Hallian/aws-ec2-instance-connect-cli
95be70889d8503964071dac227507c090a1bc980
[ "Apache-2.0" ]
null
null
null
ec2instanceconnectcli/mops.py
Hallian/aws-ec2-instance-connect-cli
95be70889d8503964071dac227507c090a1bc980
[ "Apache-2.0" ]
null
null
null
ec2instanceconnectcli/mops.py
Hallian/aws-ec2-instance-connect-cli
95be70889d8503964071dac227507c090a1bc980
[ "Apache-2.0" ]
null
null
null
# Copyright 2019 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" file acc...
44.395062
166
0.689655
import sys import argparse from ec2instanceconnectcli.EC2InstanceConnectCLI import EC2InstanceConnectCLI from ec2instanceconnectcli.EC2InstanceConnectKey import EC2InstanceConnectKey from ec2instanceconnectcli.EC2InstanceConnectCommand import EC2InstanceConnectCommand from ec2instanceconnectcli.EC2Instanc...
true
true
1c38582751f28bdc2dffc5c4099f3b071797762e
3,755
py
Python
torch_geometric/datasets/flickr.py
beneisner/pytorch_geometric
53d44a96bd2de2753b1ab1d7153c026c92606a81
[ "MIT" ]
1
2022-02-17T09:40:17.000Z
2022-02-17T09:40:17.000Z
torch_geometric/datasets/flickr.py
beneisner/pytorch_geometric
53d44a96bd2de2753b1ab1d7153c026c92606a81
[ "MIT" ]
null
null
null
torch_geometric/datasets/flickr.py
beneisner/pytorch_geometric
53d44a96bd2de2753b1ab1d7153c026c92606a81
[ "MIT" ]
1
2021-06-16T11:40:43.000Z
2021-06-16T11:40:43.000Z
from typing import Optional, Callable, List import json import os.path as osp import torch import numpy as np import scipy.sparse as sp from google_drive_downloader import GoogleDriveDownloader as gdd from torch_geometric.data import InMemoryDataset, Data class Flickr(InMemoryDataset): r"""The Flickr dataset fr...
38.71134
79
0.656724
from typing import Optional, Callable, List import json import os.path as osp import torch import numpy as np import scipy.sparse as sp from google_drive_downloader import GoogleDriveDownloader as gdd from torch_geometric.data import InMemoryDataset, Data class Flickr(InMemoryDataset): adj_full_id = '1crmsTbd1...
true
true
1c3858d364bdb885edc680b7942cf284a92dde06
192
py
Python
filer_addons/filer_gui/admin/__init__.py
benzkji/django-filer-addons
0220b1c75520dcda9ec1fe6a46e62a66735c7699
[ "MIT" ]
null
null
null
filer_addons/filer_gui/admin/__init__.py
benzkji/django-filer-addons
0220b1c75520dcda9ec1fe6a46e62a66735c7699
[ "MIT" ]
23
2017-06-17T07:11:07.000Z
2020-11-06T17:05:05.000Z
filer_addons/filer_gui/admin/__init__.py
benzkji/django-filer-addons
0220b1c75520dcda9ec1fe6a46e62a66735c7699
[ "MIT" ]
2
2017-06-20T09:25:09.000Z
2017-08-03T07:38:17.000Z
from __future__ import unicode_literals from django.contrib import admin from .api import FilerGuiAdmin from ..models import FilerGuiFile admin.site.register(FilerGuiFile, FilerGuiAdmin)
17.454545
48
0.833333
from __future__ import unicode_literals from django.contrib import admin from .api import FilerGuiAdmin from ..models import FilerGuiFile admin.site.register(FilerGuiFile, FilerGuiAdmin)
true
true
1c38592f9643bb88ae18a29c8b362c5be017dfa0
430
py
Python
jms_oidc_rp/admin.py
BaiJiangJie/jumpserver-django-oidc-rp
b2d6a63dd82214263b8971412a9043268c31ba7f
[ "MIT" ]
20
2018-04-16T13:17:35.000Z
2021-06-05T00:08:33.000Z
jms_oidc_rp/admin.py
BaiJiangJie/jumpserver-django-oidc-rp
b2d6a63dd82214263b8971412a9043268c31ba7f
[ "MIT" ]
9
2018-07-20T18:19:13.000Z
2021-12-22T08:57:18.000Z
oidc_rp/admin.py
bcgov/django-oidc-rp
50e6fa143e61b04849b4c66beef078be0d7669de
[ "MIT" ]
21
2018-07-10T16:05:44.000Z
2022-01-24T05:57:09.000Z
""" OpenID Connect relying party (RP) model admin definitions ========================================================= This module defines admin classes used to populate the Django administration dashboard. """ from django.contrib import admin from .models import OIDCUser @admin.register(OIDCUser) cl...
22.631579
91
0.616279
from django.contrib import admin from .models import OIDCUser @admin.register(OIDCUser) class UserAdmin(admin.ModelAdmin): list_display = ('sub', 'user', )
true
true
1c38594b131a1b460726372bc8e9479ebc4c1a0f
44,677
py
Python
classic_heuristics/gapvrp.py
mschmidt87/VeRyPy
3086288cf203bbe6dc488de72fb6f8ea2a1382e6
[ "MIT" ]
1
2020-07-14T15:47:07.000Z
2020-07-14T15:47:07.000Z
classic_heuristics/gapvrp.py
mrwright313/VeRyPy
eaac6e210d861441071565575750a2f0e25dfb72
[ "MIT" ]
null
null
null
classic_heuristics/gapvrp.py
mrwright313/VeRyPy
eaac6e210d861441071565575750a2f0e25dfb72
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### """ This file is a part of the VeRyPy classical vehicle routing problem heuristic library and provides an implementation of the Fisher&Jaikumar (1981) heuristic, which generates an approximate s...
47.327331
168
0.583298
emand (%.2f)" %\ (prev_node_i, cone_fraction*100, d[prev_node_i])) else: log(DEBUG-3,"Node %d, added %.2f %% of cost (%.2f)" %\ (prev_node_i, cone_fraction*100, 0.5*D[prev_node_i,i])) log(DEBUG-2,"G...
true
true
1c385a3f212c43b7b143336820cc95534fcd766b
1,761
py
Python
src/api/authentication/social_login_signup.py
ThaDeveloper/grind
fa90b65d12e6d9b3d658b132874801ecda08c57f
[ "MIT" ]
1
2019-11-06T22:26:26.000Z
2019-11-06T22:26:26.000Z
src/api/authentication/social_login_signup.py
ThaDeveloper/grind
fa90b65d12e6d9b3d658b132874801ecda08c57f
[ "MIT" ]
5
2021-03-19T02:49:44.000Z
2021-06-10T19:13:00.000Z
src/api/authentication/social_login_signup.py
ThaDeveloper/grind
fa90b65d12e6d9b3d658b132874801ecda08c57f
[ "MIT" ]
null
null
null
import uuid from rest_framework.response import Response from rest_framework import status from api.models import User from api.helpers.get_response import custom_reponse class SocialAuth: """ Logs in/ registers a new social user. """ def social_login_signup(self, user_info, **kwargs): """ ...
33.865385
74
0.545713
import uuid from rest_framework.response import Response from rest_framework import status from api.models import User from api.helpers.get_response import custom_reponse class SocialAuth: def social_login_signup(self, user_info, **kwargs): try: user = User.objects.get(email=user_info.get('...
true
true
1c385a8aa041e66422af67145f40f8881410313a
4,766
py
Python
gcloud/core/apis/drf/viewsets/utils.py
qqqqqie/bk-sops
f2e734c2cdac76f89d2e4f0fd7de36168e452141
[ "Apache-2.0" ]
881
2019-03-25T02:45:42.000Z
2022-03-30T09:10:49.000Z
gcloud/core/apis/drf/viewsets/utils.py
m0re-work/bk-sops
d03ba8a4ee0781c6daaf0dd38a7369dc82669f7d
[ "Apache-2.0" ]
3,303
2019-03-25T04:18:03.000Z
2022-03-31T11:52:03.000Z
gcloud/core/apis/drf/viewsets/utils.py
m0re-work/bk-sops
d03ba8a4ee0781c6daaf0dd38a7369dc82669f7d
[ "Apache-2.0" ]
395
2019-03-25T02:53:36.000Z
2022-03-31T08:37:28.000Z
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making ่“้ฒธๆ™บไบ‘PaaSๅนณๅฐ็คพๅŒบ็‰ˆ (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
38.128
118
0.672472
import logging from iam import Subject, Action, MultiActionRequest from iam.shortcuts import allow_or_raise_auth_failed from rest_framework import status from rest_framework.exceptions import ErrorDetail from rest_framework.response import Response from rest_framework.viewsets import GenericViewSet from gcloud impor...
true
true
1c385d6490b25ea69dde00beb4f6ee638b4d42f2
2,032
py
Python
corus/sources/taiga/nplus1.py
Ilseyar/corus
61a4776f5e534469bb9df1e451b6a6d5fc0e991b
[ "MIT" ]
205
2019-05-01T07:38:01.000Z
2022-03-30T04:02:54.000Z
corus/sources/taiga/nplus1.py
Ilseyar/corus
61a4776f5e534469bb9df1e451b6a6d5fc0e991b
[ "MIT" ]
78
2019-04-29T06:53:53.000Z
2021-09-20T14:51:25.000Z
corus/sources/taiga/nplus1.py
Ilseyar/corus
61a4776f5e534469bb9df1e451b6a6d5fc0e991b
[ "MIT" ]
18
2019-06-19T09:56:10.000Z
2022-01-30T14:55:14.000Z
from datetime import datetime from .common import ( Author, Meta, load_tar_metas, load_tar_texts, patch_month, merge_metas, ) # {'author': 'ะ’ะปะฐะดะธะผะธั€ ะšะพั€ะพะปะตะฒ', # 'authorreaders': '', # 'authortexts': '', # 'date': '21 ะฏะฝะฒ. 2017', # 'magazine': '', # 'segment': 'nplus1', # 'source'...
22.577778
69
0.572835
from datetime import datetime from .common import ( Author, Meta, load_tar_metas, load_tar_texts, patch_month, merge_metas, ) NPLUS1_MONTHS = { 'ะฏะฝะฒ.': 'Jan', 'ะคะตะฒ.': 'Feb', 'ะœะฐั€ั‚': 'Mar', 'ะะฟั€.': 'Apr', 'ะœะฐะน': 'May', 'ะ˜ัŽะฝัŒ': 'Jun', 'ะ˜ัŽะปัŒ': 'Jul', ...
true
true
1c385f91a9b3b361993612243a63eebb6335184b
6,325
py
Python
tests.py
badalraina31/snappass
f16106acc7cada1b3f77fddd312faa963e0b6e20
[ "MIT" ]
null
null
null
tests.py
badalraina31/snappass
f16106acc7cada1b3f77fddd312faa963e0b6e20
[ "MIT" ]
null
null
null
tests.py
badalraina31/snappass
f16106acc7cada1b3f77fddd312faa963e0b6e20
[ "MIT" ]
null
null
null
import re import time import unittest import uuid from unittest import TestCase from unittest import mock from urllib.parse import unquote from cryptography.fernet import Fernet from freezegun import freeze_time from werkzeug.exceptions import BadRequest from fakeredis import FakeStrictRedis # noinspection PyPep8Nami...
38.567073
106
0.655178
import re import time import unittest import uuid from unittest import TestCase from unittest import mock from urllib.parse import unquote from cryptography.fernet import Fernet from freezegun import freeze_time from werkzeug.exceptions import BadRequest from fakeredis import FakeStrictRedis import snappass.main as ...
true
true
1c3860194879062b51704087b47e5edb5d95420a
11,828
py
Python
src/probnum/randprocs/markov/integrator/_iwp.py
alpiges/probnum
2e4153cb0df559984e09ec74487ef6c9d3f6d464
[ "MIT" ]
null
null
null
src/probnum/randprocs/markov/integrator/_iwp.py
alpiges/probnum
2e4153cb0df559984e09ec74487ef6c9d3f6d464
[ "MIT" ]
40
2021-04-12T07:56:29.000Z
2022-03-28T00:18:18.000Z
src/probnum/randprocs/markov/integrator/_iwp.py
alpiges/probnum
2e4153cb0df559984e09ec74487ef6c9d3f6d464
[ "MIT" ]
null
null
null
"""Integrated Brownian motion.""" try: # cached_property is only available in Python >=3.8 from functools import cached_property except ImportError: from cached_property import cached_property import warnings import numpy as np import scipy.special from probnum import config, linops, randvars from probn...
37.07837
118
0.644234
try: from functools import cached_property except ImportError: from cached_property import cached_property import warnings import numpy as np import scipy.special from probnum import config, linops, randvars from probnum.randprocs.markov import _markov_process, continuous, discrete from probnum.randpro...
true
true
1c386043c55d45b1b88ea0a2646c4901ed16ed5a
950
py
Python
distribulator/engine/mode/Mode.py
adace74/test
b7b45fae6c4ba6ffe8a04c45b6e2bf23a918226b
[ "BSD-3-Clause" ]
null
null
null
distribulator/engine/mode/Mode.py
adace74/test
b7b45fae6c4ba6ffe8a04c45b6e2bf23a918226b
[ "BSD-3-Clause" ]
null
null
null
distribulator/engine/mode/Mode.py
adace74/test
b7b45fae6c4ba6ffe8a04c45b6e2bf23a918226b
[ "BSD-3-Clause" ]
null
null
null
###################################################################### # # $Id$ # # (c) Copyright 2004 Orbitz, Inc. All Rights Reserved. # Please see the accompanying LICENSE file for license information. # ###################################################################### # Pydoc comments """This class is the ba...
25
76
0.413684
true
true
1c38615b6e5a27005bd983f0f82fb8dfb4efac93
425
py
Python
rest/notification/list-get-example-1/list-get-example-1.5.x.py
azaddeveloper/api-snippets
f88b153cd7186fa70b33733b205886502db0d1f2
[ "MIT" ]
2
2017-11-23T11:31:20.000Z
2018-01-22T04:14:02.000Z
rest/notification/list-get-example-1/list-get-example-1.5.x.py
azaddeveloper/api-snippets
f88b153cd7186fa70b33733b205886502db0d1f2
[ "MIT" ]
null
null
null
rest/notification/list-get-example-1/list-get-example-1.5.x.py
azaddeveloper/api-snippets
f88b153cd7186fa70b33733b205886502db0d1f2
[ "MIT" ]
2
2020-05-22T23:31:21.000Z
2021-06-10T18:33:45.000Z
# Download the Python helper library from twilio.com/docs/python/install from twilio.rest import TwilioRestClient # Your Account Sid and Auth Token from twilio.com/user/account account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" auth_token = "your_auth_token" client = TwilioRestClient(account_sid, auth_token) # A list...
38.636364
72
0.828235
from twilio.rest import TwilioRestClient account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" auth_token = "your_auth_token" client = TwilioRestClient(account_sid, auth_token) notifications = client.notifications.list()
true
true
1c38619eee36a6d8e0be87801ad8d87b80681fc2
6,617
py
Python
assignment1/cs231n/classifiers/fc_net.py
qiaw99/CS231n-Convolutional-Neural-Networks-for-Visual-Recognition
5949b4f68f04e23751879dbc679e7708735d313f
[ "Apache-2.0" ]
null
null
null
assignment1/cs231n/classifiers/fc_net.py
qiaw99/CS231n-Convolutional-Neural-Networks-for-Visual-Recognition
5949b4f68f04e23751879dbc679e7708735d313f
[ "Apache-2.0" ]
null
null
null
assignment1/cs231n/classifiers/fc_net.py
qiaw99/CS231n-Convolutional-Neural-Networks-for-Visual-Recognition
5949b4f68f04e23751879dbc679e7708735d313f
[ "Apache-2.0" ]
null
null
null
from builtins import range from builtins import object import numpy as np from ..layers import * from ..layer_utils import * class TwoLayerNet(object): """ A two-layer fully-connected neural network with ReLU nonlinearity and softmax loss that uses a modular layer design. We assume an input dimension ...
47.264286
143
0.484207
from builtins import range from builtins import object import numpy as np from ..layers import * from ..layer_utils import * class TwoLayerNet(object): def __init__( self, input_dim=3 * 32 * 32, hidden_dim=100, num_classes=10, weight_scale=1e-3, reg=0.0, ): ...
true
true
1c3861b42892e0760a2b57f037101b3f9ff8dd62
11,482
py
Python
pcdet/models/roi_heads/voxelrcnn_head.py
EmiyaNing/OpenPCDet
41ff28209cb000b51626a0ed8593b0adbe3dd447
[ "Apache-2.0" ]
null
null
null
pcdet/models/roi_heads/voxelrcnn_head.py
EmiyaNing/OpenPCDet
41ff28209cb000b51626a0ed8593b0adbe3dd447
[ "Apache-2.0" ]
null
null
null
pcdet/models/roi_heads/voxelrcnn_head.py
EmiyaNing/OpenPCDet
41ff28209cb000b51626a0ed8593b0adbe3dd447
[ "Apache-2.0" ]
null
null
null
import torch import torch.nn as nn from ...ops.pointnet2.pointnet2_stack import voxel_pool_modules as voxelpool_stack_modules from ...utils import common_utils from .roi_head_template import RoIHeadTemplate class VoxelRCNNHead(RoIHeadTemplate): def __init__(self, backbone_channels, model_cfg, point_cloud_range, v...
45.027451
116
0.620536
import torch import torch.nn as nn from ...ops.pointnet2.pointnet2_stack import voxel_pool_modules as voxelpool_stack_modules from ...utils import common_utils from .roi_head_template import RoIHeadTemplate class VoxelRCNNHead(RoIHeadTemplate): def __init__(self, backbone_channels, model_cfg, point_cloud_range, v...
true
true
1c3861f9352bd1c49f29f5b231e79694c4ccbaae
1,148
py
Python
setup.py
anoadragon453/matrix-nio
e157c5fed96d75797bbb0fadaa0c473fe11b5e6a
[ "Apache-2.0" ]
null
null
null
setup.py
anoadragon453/matrix-nio
e157c5fed96d75797bbb0fadaa0c473fe11b5e6a
[ "Apache-2.0" ]
null
null
null
setup.py
anoadragon453/matrix-nio
e157c5fed96d75797bbb0fadaa0c473fe11b5e6a
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- from os import path from io import open from setuptools import find_packages, setup this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name="matrix-nio", version="0.5", ...
25.511111
78
0.585366
from os import path from io import open from setuptools import find_packages, setup this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name="matrix-nio", version="0.5", url="https://github...
true
true
1c386306cbf996ad6e0e5a309be4b1867d2be2d2
127
py
Python
iot_kernel/__main__.py
iot49/iot-kernel
5eb3e32a7e63b6ce5297cbab3df48d50d45cad50
[ "MIT" ]
2
2021-07-01T12:32:43.000Z
2021-12-16T22:21:20.000Z
iot_kernel/__main__.py
iot49/iot-kernel
5eb3e32a7e63b6ce5297cbab3df48d50d45cad50
[ "MIT" ]
null
null
null
iot_kernel/__main__.py
iot49/iot-kernel
5eb3e32a7e63b6ce5297cbab3df48d50d45cad50
[ "MIT" ]
null
null
null
from ipykernel.kernelapp import IPKernelApp from .kernel import IoTKernel IPKernelApp.launch_instance(kernel_class=IoTKernel)
25.4
51
0.874016
from ipykernel.kernelapp import IPKernelApp from .kernel import IoTKernel IPKernelApp.launch_instance(kernel_class=IoTKernel)
true
true
1c3864289d1471dfe5e1c5439cfcea90e3d1c2a2
1,438
py
Python
tests/test_filename_checking.py
rcbops/flake8-filename
1bfb0f6174e11bf6d3750aecddcb8e0216ad645b
[ "Apache-2.0" ]
null
null
null
tests/test_filename_checking.py
rcbops/flake8-filename
1bfb0f6174e11bf6d3750aecddcb8e0216ad645b
[ "Apache-2.0" ]
4
2018-05-30T14:31:43.000Z
2020-08-10T08:23:28.000Z
tests/test_filename_checking.py
rcbops/flake8-filename
1bfb0f6174e11bf6d3750aecddcb8e0216ad645b
[ "Apache-2.0" ]
4
2018-05-25T15:21:38.000Z
2020-02-22T13:04:24.000Z
# -*- coding: utf-8 -*- import pytest # args to only use checks that raise an 'N' prefixed error extra_args = ['--select', 'N'] config = r""" [flake8] filename_check1 = filter_regex=test_.+ filename_regex=test_[\w-]+$ """ def test_pass_filter_and_match_filename(flake8dir): """Verify that no v...
27.132075
114
0.698192
import pytest extra_args = ['--select', 'N'] config = r""" [flake8] filename_check1 = filter_regex=test_.+ filename_regex=test_[\w-]+$ """ def test_pass_filter_and_match_filename(flake8dir): flake8dir.make_setup_cfg(config) flake8dir.make_file('test_File-10.py', 'import sys') ...
true
true
1c38649c2ee470c2fd8143faecb7a0b42c0a9261
3,292
py
Python
targets/waxwing/base.py
timvideos/litex-buildenv
a103774342c0265458979a79082b233d9ce08edb
[ "BSD-2-Clause" ]
198
2018-01-17T05:39:54.000Z
2022-03-15T08:59:16.000Z
targets/waxwing/base.py
timvideos/litex-buildenv
a103774342c0265458979a79082b233d9ce08edb
[ "BSD-2-Clause" ]
610
2017-12-31T01:32:32.000Z
2022-03-19T22:07:28.000Z
targets/waxwing/base.py
timvideos/litex-buildenv
a103774342c0265458979a79082b233d9ce08edb
[ "BSD-2-Clause" ]
85
2018-01-13T05:51:38.000Z
2022-02-11T18:54:14.000Z
# Support for the Numato Saturn (http://numato.com/product/saturn-spartan-6-fpga-development-board-with-ddr-sdram) from fractions import Fraction from migen import * from litex.soc.integration.soc_sdram import * from litex.soc.integration.builder import * from litex.soc.interconnect import wishbone from litedram.mo...
38.729412
114
0.545869
from fractions import Fraction from migen import * from litex.soc.integration.soc_sdram import * from litex.soc.integration.builder import * from litex.soc.interconnect import wishbone from litedram.modules import MT46H32M16 from litedram.phy import s6ddrphy from litedram.core import ControllerSettings from targe...
true
true
1c3864a2202941f66300375795f86ea08723517c
9,270
py
Python
sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_metadata_sync_configs_operations.py
rsdoherty/azure-sdk-for-python
6bba5326677468e6660845a703686327178bb7b1
[ "MIT" ]
2,728
2015-01-09T10:19:32.000Z
2022-03-31T14:50:33.000Z
sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_metadata_sync_configs_operations.py
rsdoherty/azure-sdk-for-python
6bba5326677468e6660845a703686327178bb7b1
[ "MIT" ]
17,773
2015-01-05T15:57:17.000Z
2022-03-31T23:50:25.000Z
sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_metadata_sync_configs_operations.py
rsdoherty/azure-sdk-for-python
6bba5326677468e6660845a703686327178bb7b1
[ "MIT" ]
1,916
2015-01-19T05:05:41.000Z
2022-03-31T19:36:44.000Z
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
48.789474
213
0.68123
from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.m...
true
true
1c3864ebd82b1039ffbfd4ca1a853f561a39ca03
15,279
py
Python
mol_dqn/experimental/multi_obj_opt.py
awesome-archive/google-research
6b3c751abbf658b33fb03e51d7b84105d2dbea68
[ "Apache-2.0" ]
1
2019-02-16T12:17:14.000Z
2019-02-16T12:17:14.000Z
mol_dqn/experimental/multi_obj_opt.py
awesome-archive/google-research
6b3c751abbf658b33fb03e51d7b84105d2dbea68
[ "Apache-2.0" ]
null
null
null
mol_dqn/experimental/multi_obj_opt.py
awesome-archive/google-research
6b3c751abbf658b33fb03e51d7b84105d2dbea68
[ "Apache-2.0" ]
1
2019-01-27T13:03:12.000Z
2019-01-27T13:03:12.000Z
# coding=utf-8 # Copyright 2018 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
35.532558
80
0.70214
from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import json import os import random import time from absl import app from absl import flags from absl import logging from baselines.common import schedules from baselines.deepq...
true
true
1c3865b1827c97a761c449a50ba5bd9d5d47a5ae
428
py
Python
logger/logger.py
LalithAdhithya/HandWritten-Digit-Recognition-using-pytorch
b7e99f70a95996886dbdfbfe1d336eaf98eb0cf3
[ "MIT" ]
1
2021-11-20T03:10:09.000Z
2021-11-20T03:10:09.000Z
logger/logger.py
ketangangal/HandWritten-Digit-Recognition-Pytorch
622772c23a59dece9d758338ab4be35064e1c88f
[ "MIT" ]
null
null
null
logger/logger.py
ketangangal/HandWritten-Digit-Recognition-Pytorch
622772c23a59dece9d758338ab4be35064e1c88f
[ "MIT" ]
null
null
null
from datetime import datetime class Logger: def __init__(self, file="logger/general/logs.log"): self.file = file def info(self, log_type, log_message): now = datetime.now() current_time = now.strftime("%d-%m-%Y %H:%M:%S") with open(self.file,"a+") as file: file.wri...
32.923077
107
0.565421
from datetime import datetime class Logger: def __init__(self, file="logger/general/logs.log"): self.file = file def info(self, log_type, log_message): now = datetime.now() current_time = now.strftime("%d-%m-%Y %H:%M:%S") with open(self.file,"a+") as file: file.wri...
true
true
1c38667ce9ae88fa83fe5e9d1903cb559ab2f6b4
4,908
py
Python
torchtime/transforms/functional.py
VincentSch4rf/torchtime
bebd006cd67b31c342e0658285c9771c27411df0
[ "Apache-2.0" ]
4
2022-02-21T21:23:16.000Z
2022-03-28T09:06:14.000Z
torchtime/transforms/functional.py
VincentSch4rf/torchtime
bebd006cd67b31c342e0658285c9771c27411df0
[ "Apache-2.0" ]
null
null
null
torchtime/transforms/functional.py
VincentSch4rf/torchtime
bebd006cd67b31c342e0658285c9771c27411df0
[ "Apache-2.0" ]
null
null
null
import warnings from typing import Any, List, Sequence, Tuple, Optional, Union, Set import numpy as np import torch from torch import Tensor import torch.nn.functional as F from ..exceptions import DataConversionWarning from ..utils import _check_unknown @torch.jit.unused def _is_numpy(ts: Any) -> bool: return ...
34.808511
116
0.639976
import warnings from typing import Any, List, Sequence, Tuple, Optional, Union, Set import numpy as np import torch from torch import Tensor import torch.nn.functional as F from ..exceptions import DataConversionWarning from ..utils import _check_unknown @torch.jit.unused def _is_numpy(ts: Any) -> bool: return ...
true
true
1c38670351f57dce763404bbccdc3ada447c883f
24,105
py
Python
reservoirpy/_base.py
neuronalX/reservoirpy
b150f097451edfa71dbfaee474149b628cd786d4
[ "MIT" ]
18
2019-03-01T17:15:17.000Z
2020-12-08T13:12:49.000Z
reservoirpy/_base.py
neuronalX/FunkyReservoir
37751e9a6be76298e1c14b3816f191f351bfb606
[ "MIT" ]
4
2019-02-19T09:25:50.000Z
2020-06-04T16:01:54.000Z
reservoirpy/_base.py
neuronalX/FunkyReservoir
37751e9a6be76298e1c14b3816f191f351bfb606
[ "MIT" ]
12
2019-02-08T08:03:42.000Z
2020-12-16T09:35:47.000Z
# Author: Nathan Trouvain at 15/02/2022 <nathan.trouvain@inria.fr> # Licence: MIT License # Copyright: Xavier Hinaut (2018) <xavier.hinaut@inria.fr> from abc import ABC, abstractmethod from contextlib import contextmanager from typing import Any, Dict, Iterator, Sequence, Union from uuid import uuid4 import numpy as n...
32.097204
88
0.541713
from abc import ABC, abstractmethod from contextlib import contextmanager from typing import Any, Dict, Iterator, Sequence, Union from uuid import uuid4 import numpy as np from .type import MappedData, Shape from .utils import progress from .utils.validation import check_vector, is_mapping def _distant_model_inp...
true
true
1c38676aebd896c554453761a10d47ee56f4f383
2,582
py
Python
e3nn/nn/_fc.py
simonbatzner/e3nn
9f5e336d5443d26a04d37162c10eb851beb0f5c5
[ "MIT" ]
null
null
null
e3nn/nn/_fc.py
simonbatzner/e3nn
9f5e336d5443d26a04d37162c10eb851beb0f5c5
[ "MIT" ]
null
null
null
e3nn/nn/_fc.py
simonbatzner/e3nn
9f5e336d5443d26a04d37162c10eb851beb0f5c5
[ "MIT" ]
null
null
null
import torch from e3nn.math import normalize2mom from e3nn.util.jit import compile_mode def _identity(x): return x # This is a static network that can be traced @compile_mode('trace') class FullyConnectedNet(torch.nn.Module): r"""Fully-connected Neural Network Parameters ---------- hs : list o...
28.688889
107
0.524787
import torch from e3nn.math import normalize2mom from e3nn.util.jit import compile_mode def _identity(x): return x @compile_mode('trace') class FullyConnectedNet(torch.nn.Module): def __init__(self, hs, act=None, variance_in=1, variance_out=1, out_act=False): super().__init__() self.hs = t...
true
true
1c3868f4caf7e0f6a4337cab535f29ba1bfe9bbd
5,414
py
Python
tests/utils_tests/test_crypto.py
rushuifang/django
b94764e178056a2118eff3f53f567207219e737d
[ "CNRI-Python-GPL-Compatible", "BSD-3-Clause" ]
2
2020-01-17T17:35:21.000Z
2020-01-17T17:35:27.000Z
tests/utils_tests/test_crypto.py
rushuifang/django
b94764e178056a2118eff3f53f567207219e737d
[ "CNRI-Python-GPL-Compatible", "BSD-3-Clause" ]
null
null
null
tests/utils_tests/test_crypto.py
rushuifang/django
b94764e178056a2118eff3f53f567207219e737d
[ "CNRI-Python-GPL-Compatible", "BSD-3-Clause" ]
2
2021-05-13T13:56:12.000Z
2021-06-13T19:56:44.000Z
import hashlib import unittest from django.utils.crypto import constant_time_compare, pbkdf2, salted_hmac class TestUtilsCryptoMisc(unittest.TestCase): def test_constant_time_compare(self): # It's hard to test for constant time, just test the result. self.assertTrue(constant_time_compare(b'spam'...
33.214724
106
0.476912
import hashlib import unittest from django.utils.crypto import constant_time_compare, pbkdf2, salted_hmac class TestUtilsCryptoMisc(unittest.TestCase): def test_constant_time_compare(self): self.assertTrue(constant_time_compare(b'spam', b'spam')) self.assertFalse(constant_time_compare(b...
true
true
1c386af021f88e573d27c874eebd300562f672b0
48,057
py
Python
builder/frameworks/espidf.py
lkaino/platform-espressif32
7406e9efb90c4a5c11bb7e08fc4869a38cf42ea8
[ "Apache-2.0" ]
7
2021-08-13T09:14:35.000Z
2022-01-31T20:24:41.000Z
builder/frameworks/espidf.py
lkaino/platform-espressif32
7406e9efb90c4a5c11bb7e08fc4869a38cf42ea8
[ "Apache-2.0" ]
4
2022-01-26T07:31:25.000Z
2022-03-13T10:35:25.000Z
builder/frameworks/espidf.py
lkaino/platform-espressif32
7406e9efb90c4a5c11bb7e08fc4869a38cf42ea8
[ "Apache-2.0" ]
4
2021-11-18T07:10:30.000Z
2022-03-24T13:44:10.000Z
# Copyright 2020-present PlatformIO <contact@platformio.org> # # 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 applicabl...
32.781037
130
0.626652
import copy import json import subprocess import sys import os import click import semantic_version from SCons.Script import ( ARGUMENTS, COMMAND_LINE_TARGETS, DefaultEnvironment, ) from platformio import fs from platformio.proc import exec_command from platformio.util import get_systype f...
true
true
1c386b015eef9e74ea213d83168770d90c057f18
83,694
py
Python
build/android/gyp/write_build_config.py
gengleilei/wee8
a7bff18685ddfc7f16de825c9d3a12432d4138d5
[ "BSD-3-Clause" ]
null
null
null
build/android/gyp/write_build_config.py
gengleilei/wee8
a7bff18685ddfc7f16de825c9d3a12432d4138d5
[ "BSD-3-Clause" ]
null
null
null
build/android/gyp/write_build_config.py
gengleilei/wee8
a7bff18685ddfc7f16de825c9d3a12432d4138d5
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python # # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Writes a build_config file. The build_config file for a target is a json file containing information about how to build that targ...
41.784324
80
0.722824
from __future__ import print_function import collections import itertools import json import optparse import os import sys import xml.dom.minidom from util import build_utils from util import resource_utils _ROOT_TYPES = ('android_apk', 'java_binary', 'java_annotation_processor', 'junit_binary...
true
true
1c386d25c75cabcae6810281f5a96424983e664d
2,465
py
Python
src/mbed_tools/cli/main.py
jainvikas8/mbed-tools
55435a4c5a7184038e1fde8e7b1c4194fa75ab8a
[ "Apache-2.0" ]
null
null
null
src/mbed_tools/cli/main.py
jainvikas8/mbed-tools
55435a4c5a7184038e1fde8e7b1c4194fa75ab8a
[ "Apache-2.0" ]
null
null
null
src/mbed_tools/cli/main.py
jainvikas8/mbed-tools
55435a4c5a7184038e1fde8e7b1c4194fa75ab8a
[ "Apache-2.0" ]
null
null
null
# # Copyright (C) 2020 Arm Mbed. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # """Main cli entry point.""" import logging from pkg_resources import get_distribution from typing import Union, Any import click from mbed_tools.lib.logging import set_log_level, MbedToolsHandler from mbed_tools.cli.configu...
31.602564
117
0.726166
import logging from pkg_resources import get_distribution from typing import Union, Any import click from mbed_tools.lib.logging import set_log_level, MbedToolsHandler from mbed_tools.cli.configure import configure from mbed_tools.cli.list_connected_devices import list_connected_devices from mbed_tools.cli.env_c...
true
true
1c386e6e932f1a3a526952a0150d184afbe6588e
3,630
py
Python
tests/test_utils.py
pynista/telegrambotapiwrapper
4310882a1a7db94f5256b010ff8a3103b405dc0d
[ "MIT" ]
1
2021-05-10T06:49:52.000Z
2021-05-10T06:49:52.000Z
tests/test_utils.py
pynista/telegrambotapiwrapper
4310882a1a7db94f5256b010ff8a3103b405dc0d
[ "MIT" ]
null
null
null
tests/test_utils.py
pynista/telegrambotapiwrapper
4310882a1a7db94f5256b010ff8a3103b405dc0d
[ "MIT" ]
null
null
null
import unittest from telegrambotapiwrapper.request import replace__from___to__from from telegrambotapiwrapper.response import is_str_int_float_bool from telegrambotapiwrapper.response import replace__from__by__from_ def is_ends_with_underscore(value: str): """Does value end with underscore.""" if value == ""...
33.611111
72
0.50854
import unittest from telegrambotapiwrapper.request import replace__from___to__from from telegrambotapiwrapper.response import is_str_int_float_bool from telegrambotapiwrapper.response import replace__from__by__from_ def is_ends_with_underscore(value: str): if value == "": return False else: r...
true
true
1c386ee9726c7ae77bf8398030c2377cee80db26
1,443
py
Python
smtools/extract_tarfile.py
hrsma2i/smtools
d52394b17fa2870dd4a48f7d14db9bbbbb25b9f2
[ "MIT" ]
null
null
null
smtools/extract_tarfile.py
hrsma2i/smtools
d52394b17fa2870dd4a48f7d14db9bbbbb25b9f2
[ "MIT" ]
null
null
null
smtools/extract_tarfile.py
hrsma2i/smtools
d52394b17fa2870dd4a48f7d14db9bbbbb25b9f2
[ "MIT" ]
null
null
null
import os from glob import glob import tarfile import argparse def extract_tarfile(inp_dir, remove=True): try: tar_file = sorted(glob(os.path.join(inp_dir, '*.tar.gz')))[0] except IndexError as e: print(e) print('There is no tar file in {}'.format(inp_dir)) tar_file = concat(in...
25.767857
70
0.605683
import os from glob import glob import tarfile import argparse def extract_tarfile(inp_dir, remove=True): try: tar_file = sorted(glob(os.path.join(inp_dir, '*.tar.gz')))[0] except IndexError as e: print(e) print('There is no tar file in {}'.format(inp_dir)) tar_file = concat(in...
true
true
1c386ffc62e6cdddb2329450ddc928e7cd854dbb
1,124
py
Python
helper/tile.py
LHGames-2018/DCI4espaces
0b5dfed8b99d07f3f13ef4b9861494155922bc8b
[ "MIT" ]
null
null
null
helper/tile.py
LHGames-2018/DCI4espaces
0b5dfed8b99d07f3f13ef4b9861494155922bc8b
[ "MIT" ]
null
null
null
helper/tile.py
LHGames-2018/DCI4espaces
0b5dfed8b99d07f3f13ef4b9861494155922bc8b
[ "MIT" ]
null
null
null
from helper.structs import Point from enum import Enum class Tile: def __init__(self, tile_content, x, y): self.TileContent = tile_content self.Position = Point(x, y) pass def __repr__(self): return "(%d, %d, %s)" % (self.Position.x, self.Position.y, TileContent.getName(se...
24.434783
105
0.579181
from helper.structs import Point from enum import Enum class Tile: def __init__(self, tile_content, x, y): self.TileContent = tile_content self.Position = Point(x, y) pass def __repr__(self): return "(%d, %d, %s)" % (self.Position.x, self.Position.y, TileContent.getName(se...
true
true
1c3871446e687861dd4a4be80b24d839b6dde3e5
384
py
Python
src/RQ4_exp2/test.py
ai-se/bellwether-configuration
921ec881b17f29ed73bdb5b4510c2a30a6d23ef4
[ "Unlicense" ]
null
null
null
src/RQ4_exp2/test.py
ai-se/bellwether-configuration
921ec881b17f29ed73bdb5b4510c2a30a6d23ef4
[ "Unlicense" ]
1
2018-05-09T15:05:01.000Z
2018-05-09T15:05:01.000Z
src/RQ4_exp2/test.py
ai-se/BEETLE__FSE_2018
921ec881b17f29ed73bdb5b4510c2a30a6d23ef4
[ "Unlicense" ]
1
2020-09-08T18:15:38.000Z
2020-09-08T18:15:38.000Z
import pickle import numpy as np pickle_file = 'experiment_pickle_4_0.1_4.p' content = pickle.load(open(pickle_file)) familys = content.keys() for family in familys: collected = [] measurements = content[family] for measurement in measurements: collected.append(np.mean(measurement[1])) print...
24
72
0.71875
import pickle import numpy as np pickle_file = 'experiment_pickle_4_0.1_4.p' content = pickle.load(open(pickle_file)) familys = content.keys() for family in familys: collected = [] measurements = content[family] for measurement in measurements: collected.append(np.mean(measurement[1])) print...
false
true
1c38719c8678e05b32268f4953f347590b317c36
20,919
py
Python
core/domain/blog_services.py
WebFlakyTest/oppia
520e35490eae8171beb035fbafc2948983abec75
[ "Apache-2.0" ]
1
2021-08-17T20:33:12.000Z
2021-08-17T20:33:12.000Z
core/domain/blog_services.py
WebFlakyTest/oppia
520e35490eae8171beb035fbafc2948983abec75
[ "Apache-2.0" ]
null
null
null
core/domain/blog_services.py
WebFlakyTest/oppia
520e35490eae8171beb035fbafc2948983abec75
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 # # Copyright 2021 The Oppia 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 requi...
33.849515
117
0.713849
from __future__ import absolute_import from __future__ import unicode_literals import datetime from constants import constants from core.domain import blog_domain from core.domain import html_cleaner from core.domain import role_services from core.platform import models import feconf import pytho...
true
true
1c3871e35a981db48c53da28b1aaaae1d572059f
298
py
Python
external/odds/__init__.py
dmartin35/pronosfoot
861ae091fbb65684d00ae8c5ff3726eeaa306ed7
[ "MIT" ]
4
2017-07-09T21:18:18.000Z
2022-02-16T13:05:10.000Z
external/odds/__init__.py
dmartin35/pronosfoot
861ae091fbb65684d00ae8c5ff3726eeaa306ed7
[ "MIT" ]
2
2020-01-16T14:21:42.000Z
2021-03-02T18:34:15.000Z
external/odds/__init__.py
dmartin35/pronosfoot
861ae091fbb65684d00ae8c5ff3726eeaa306ed7
[ "MIT" ]
null
null
null
from external.odds.betclic.api import get_odds #ย FDJ parsing is broken - their UI has been refactored with JS framework & # protected async JSON API usage (requires HEADERS) and more complex to isolate & group match odds # hence move to another betting website - which is still full html rendered
49.666667
98
0.788591
from external.odds.betclic.api import get_odds
true
true
1c3872127e305c1d6af42c66f910cbac6696d91c
72,366
py
Python
Python-Client/project/myService.py
d0d0d0/Persona
cbea1dfaae1d44b286d9b350ccba36bc7fca4a5a
[ "MIT" ]
null
null
null
Python-Client/project/myService.py
d0d0d0/Persona
cbea1dfaae1d44b286d9b350ccba36bc7fca4a5a
[ "MIT" ]
null
null
null
Python-Client/project/myService.py
d0d0d0/Persona
cbea1dfaae1d44b286d9b350ccba36bc7fca4a5a
[ "MIT" ]
null
null
null
# # Autogenerated by Thrift Compiler (0.9.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport ...
29.890954
188
0.657118
from thrift.Thrift import TType, TMessageType, TException, TApplicationException from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.protocol import fastbinary except: fastbinary = None cl...
true
true
1c387240f490f241b3ff3d21da0f3d7bafabda5d
1,659
py
Python
day15/day15.py
protocol114/AdventOfCode
eec7eed81cf9f096e2dce9a9a39f5e9890a3deaf
[ "MIT" ]
null
null
null
day15/day15.py
protocol114/AdventOfCode
eec7eed81cf9f096e2dce9a9a39f5e9890a3deaf
[ "MIT" ]
null
null
null
day15/day15.py
protocol114/AdventOfCode
eec7eed81cf9f096e2dce9a9a39f5e9890a3deaf
[ "MIT" ]
null
null
null
f = open("input.txt", "r") ingredients = [] for line in f: temp = [] _, _, capacity, _, durability, _, flavor, _, texture, _, calories = line.split() temp.append(int(capacity.strip(','))) temp.append(int(durability.strip(','))) temp.append(int(flavor.strip(','))) temp.append(int(texture.strip(...
38.581395
124
0.537673
f = open("input.txt", "r") ingredients = [] for line in f: temp = [] _, _, capacity, _, durability, _, flavor, _, texture, _, calories = line.split() temp.append(int(capacity.strip(','))) temp.append(int(durability.strip(','))) temp.append(int(flavor.strip(','))) temp.append(int(texture.strip(...
true
true
1c38728a1651dbc1726420ff21bcd15bdfb63d88
1,070
py
Python
images/models.py
lightguy875/Django_social_media
11d9faf4dde4b1a3b74ad71c0d9f53d3e630c103
[ "Apache-2.0" ]
1
2020-08-10T13:03:13.000Z
2020-08-10T13:03:13.000Z
images/models.py
lightguy875/Django_social_media
11d9faf4dde4b1a3b74ad71c0d9f53d3e630c103
[ "Apache-2.0" ]
7
2021-06-04T23:50:18.000Z
2022-03-12T00:45:48.000Z
images/models.py
lightguy875/Django_social_media
11d9faf4dde4b1a3b74ad71c0d9f53d3e630c103
[ "Apache-2.0" ]
null
null
null
from django.db import models from django.conf import settings from django.utils.text import slugify from django.urls import reverse # Create your models here. class Image(models.Model): users_like = models.ManyToManyField(settings.AUTH_USER_MODEL,related_name='images_liked',blank=True) user = models.ForeignKey(...
39.62963
110
0.723364
from django.db import models from django.conf import settings from django.utils.text import slugify from django.urls import reverse class Image(models.Model): users_like = models.ManyToManyField(settings.AUTH_USER_MODEL,related_name='images_liked',blank=True) user = models.ForeignKey(settings.AUTH_USER_MODEL, ...
true
true
1c38751248735d1b99301b3fdab6685abfcc16e0
15,654
py
Python
experimental/language_structure/psl/psl_model_multiwoz_test.py
jaeikjeon9919/uncertainty-baselines
15aad70bb585452d84c0afa74208338f5db5f70e
[ "Apache-2.0" ]
null
null
null
experimental/language_structure/psl/psl_model_multiwoz_test.py
jaeikjeon9919/uncertainty-baselines
15aad70bb585452d84c0afa74208338f5db5f70e
[ "Apache-2.0" ]
null
null
null
experimental/language_structure/psl/psl_model_multiwoz_test.py
jaeikjeon9919/uncertainty-baselines
15aad70bb585452d84c0afa74208338f5db5f70e
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # Copyright 2021 The Uncertainty Baselines Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
41.855615
110
0.654401
import tensorflow as tf import constrained_evaluation as eval_model import data import psl_model_multiwoz as model import psl_model_multiwoz_test_util as test_util class PslRulesTest(tf.test.TestCase): def setUp(self): super(PslRulesTest, self).setUp() self.config = test_util.TEST_...
true
true
1c3875240b88f854a299beba1c25846f720cfbcb
6,041
py
Python
Duelist_Algorithm.py
ebruyasar11/Duelist-Algorithm
d740e0a26a33a230434441b5bcf67b1e7a7c5fd2
[ "MIT" ]
1
2021-06-02T15:34:00.000Z
2021-06-02T15:34:00.000Z
Duelist_Algorithm.py
ebruyasar11/Duelist-Algorithm
d740e0a26a33a230434441b5bcf67b1e7a7c5fd2
[ "MIT" ]
null
null
null
Duelist_Algorithm.py
ebruyasar11/Duelist-Algorithm
d740e0a26a33a230434441b5bcf67b1e7a7c5fd2
[ "MIT" ]
null
null
null
import numpy as np import random import time import matplotlib.pyplot as mp class Duelist_Algorithm(): def __init__(self,f,x,altdeger,ustdeger,pop=200,sans=0.01,mutasyon=0.1,ogren=0.8,iterasyon=500,nc=5,karistir=False): #Sฤฑnฤฑf deฤŸiลŸkenlerinin tanฤฑmlamalarฤฑ self.f = f self.x = x self.altdeger = altdeger self...
33.375691
121
0.692766
import numpy as np import random import time import matplotlib.pyplot as mp class Duelist_Algorithm(): def __init__(self,f,x,altdeger,ustdeger,pop=200,sans=0.01,mutasyon=0.1,ogren=0.8,iterasyon=500,nc=5,karistir=False): self.f = f self.x = x self.altdeger = altdeger self.ustdeger = ustdeger self.populasy...
true
true
1c3875eec768725e04f838322599ca3ca2fc43f3
8,450
py
Python
tools/test_crowdhuman.py
Ernstsen/Pedestron
0c5aa35881561bcd0acf5de8939472efd6409256
[ "Apache-2.0" ]
594
2020-03-20T11:52:59.000Z
2022-03-30T11:58:55.000Z
tools/test_crowdhuman.py
Ernstsen/Pedestron
0c5aa35881561bcd0acf5de8939472efd6409256
[ "Apache-2.0" ]
131
2020-03-25T09:48:04.000Z
2022-03-30T17:54:38.000Z
tools/test_crowdhuman.py
Ernstsen/Pedestron
0c5aa35881561bcd0acf5de8939472efd6409256
[ "Apache-2.0" ]
128
2020-03-20T14:22:11.000Z
2022-03-22T09:41:39.000Z
import argparse import os import os.path as osp import shutil import tempfile import json import time import mmcv import torch import torch.distributed as dist from mmcv.runner import load_checkpoint, get_dist_info from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmdet.apis import init_dist fr...
37.22467
142
0.60213
import argparse import os import os.path as osp import shutil import tempfile import json import time import mmcv import torch import torch.distributed as dist from mmcv.runner import load_checkpoint, get_dist_info from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmdet.apis import init_dist fr...
true
true
1c38768a0bf2c6600f6129ebdcec86e801059f7a
262
py
Python
setup.py
MarcMarabou/02476_ml_ops_project
0a46bca731271287f6ba00270e8b18e76323fcae
[ "FTL" ]
null
null
null
setup.py
MarcMarabou/02476_ml_ops_project
0a46bca731271287f6ba00270e8b18e76323fcae
[ "FTL" ]
1
2022-01-20T09:16:37.000Z
2022-01-20T09:16:37.000Z
setup.py
MarcMarabou/02476_ml_ops_project
0a46bca731271287f6ba00270e8b18e76323fcae
[ "FTL" ]
null
null
null
from setuptools import find_packages, setup setup( name="src", packages=find_packages(), version="0.1.0", description="A short description of the project.", author="Your name (or your organization/company/team)", license="", )
23.818182
60
0.652672
from setuptools import find_packages, setup setup( name="src", packages=find_packages(), version="0.1.0", description="A short description of the project.", author="Your name (or your organization/company/team)", license="", )
true
true
1c387750188c0c363aa55562e890fe6e14eb7296
7,878
py
Python
api/utils.py
josuelopes512/mastercode_films_api
ab8ea5ce55a1eeee90a1ec3c5447434ca37d83bb
[ "Apache-2.0" ]
null
null
null
api/utils.py
josuelopes512/mastercode_films_api
ab8ea5ce55a1eeee90a1ec3c5447434ca37d83bb
[ "Apache-2.0" ]
null
null
null
api/utils.py
josuelopes512/mastercode_films_api
ab8ea5ce55a1eeee90a1ec3c5447434ca37d83bb
[ "Apache-2.0" ]
null
null
null
from django.utils.text import slugify from threading import Thread from random import randint from pathlib import Path import environ, base64, requests as req BASE_DIR = Path(__file__).resolve().parent.parent env = environ.Env() environ.Env.read_env(BASE_DIR / '.env') API_KEY= env('API_KEY') URL_DB = 'https://api...
35.327354
123
0.627444
from django.utils.text import slugify from threading import Thread from random import randint from pathlib import Path import environ, base64, requests as req BASE_DIR = Path(__file__).resolve().parent.parent env = environ.Env() environ.Env.read_env(BASE_DIR / '.env') API_KEY= env('API_KEY') URL_DB = 'https://api...
true
true
1c387750eed6826249cb679584ede439dce7288e
1,592
py
Python
likeapp/utils.py
verhovensky/likeapprestapi
4a87690a37568041d5498c8b94259704af080af1
[ "MIT" ]
null
null
null
likeapp/utils.py
verhovensky/likeapprestapi
4a87690a37568041d5498c8b94259704af080af1
[ "MIT" ]
null
null
null
likeapp/utils.py
verhovensky/likeapprestapi
4a87690a37568041d5498c8b94259704af080af1
[ "MIT" ]
null
null
null
from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from .models import Like # import datetime # Bishkek Time zone # import pytz # timezone = pytz.timezone("Asia/Bishkek") User = get_user_model() def add_like(obj, user): """Like `obj`. """ obj_type = ...
26.533333
89
0.612437
from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from .models import Like User = get_user_model() def add_like(obj, user): obj_type = ContentType.objects.get_for_model(obj) like, is_created = Like.objects.get_or_create( content_type=obj_typ...
true
true
1c387a98241666d68205340ff5d7afecd591a0f2
576
py
Python
unit 9/exc. 9.2.3.py
AviKalPython/self.py
44f8de33797a9ea28bbd1e01006920ba7c818b97
[ "MIT" ]
null
null
null
unit 9/exc. 9.2.3.py
AviKalPython/self.py
44f8de33797a9ea28bbd1e01006920ba7c818b97
[ "MIT" ]
null
null
null
unit 9/exc. 9.2.3.py
AviKalPython/self.py
44f8de33797a9ea28bbd1e01006920ba7c818b97
[ "MIT" ]
null
null
null
# exc. 9.2.3 def who_is_missing(file_name): find_the_num = open(file_name, "r") numbers = find_the_num.read() number_list = [int(x) for x in numbers.split(",")] number_list.sort() #print(number_list) i = number_list[0] for num in number_list: if i not in number_list: found = i i += 1 find_th...
23.04
58
0.663194
def who_is_missing(file_name): find_the_num = open(file_name, "r") numbers = find_the_num.read() number_list = [int(x) for x in numbers.split(",")] number_list.sort() i = number_list[0] for num in number_list: if i not in number_list: found = i i += 1 find_the_num.close() new_text = open...
true
true
1c387ab39db476e5a6f23a51533f27992deec27c
749
py
Python
daoagent/log.py
Symantec/dao-agent
601ac49d2512b539c58a7026b1f8fb76645ba9a6
[ "Apache-2.0" ]
null
null
null
daoagent/log.py
Symantec/dao-agent
601ac49d2512b539c58a7026b1f8fb76645ba9a6
[ "Apache-2.0" ]
null
null
null
daoagent/log.py
Symantec/dao-agent
601ac49d2512b539c58a7026b1f8fb76645ba9a6
[ "Apache-2.0" ]
2
2019-09-18T22:51:31.000Z
2021-02-26T10:19:32.000Z
# Copyright 2016 Symantec, 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 writi...
35.666667
75
0.757009
import logging logging.basicConfig(filename='/tmp/validation.log', level=logging.DEBUG) def get_logger(*args, **kwargs): return logging.getLogger(*args, **kwargs)
true
true
1c387b3d34a16ac37f56f4e5e23e7b8e09236e94
11,755
py
Python
src/plugins/NextStep/NextStep/__init__.py
rpicard92/petri-net-webgme-app
3ab1808cd4f1f5bb516be66b39daf7a74b8660c5
[ "MIT" ]
1
2020-09-09T01:23:04.000Z
2020-09-09T01:23:04.000Z
src/plugins/NextStep/NextStep/__init__.py
rpicard92/petri-net-webgme-app
3ab1808cd4f1f5bb516be66b39daf7a74b8660c5
[ "MIT" ]
null
null
null
src/plugins/NextStep/NextStep/__init__.py
rpicard92/petri-net-webgme-app
3ab1808cd4f1f5bb516be66b39daf7a74b8660c5
[ "MIT" ]
null
null
null
""" This is where the implementation of the plugin code goes. The NextStep-class is imported from both run_plugin.py and run_debug.py """ import sys import logging import random from webgme_bindings import PluginBase # Setup a logger logger = logging.getLogger('NextStep') logger.setLevel(logging.INFO) hand...
47.979592
335
0.527946
import sys import logging import random from webgme_bindings import PluginBase logger = logging.getLogger('NextStep') logger.setLevel(logging.INFO) handler = logging.StreamHandler(sys.stdout) handler.setLevel(logging.INFO) formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')...
true
true
1c387b757cb81b71f694b90c41926c678de27943
1,656
py
Python
import.py
hornetmadness/pfsence-voucher-printer
5dd2a36f7f44480875131ca1724072d4a4444d4a
[ "MIT" ]
2
2020-07-04T23:44:55.000Z
2021-06-03T20:05:12.000Z
import.py
hornetmadness/pfsence-voucher-printer
5dd2a36f7f44480875131ca1724072d4a4444d4a
[ "MIT" ]
null
null
null
import.py
hornetmadness/pfsence-voucher-printer
5dd2a36f7f44480875131ca1724072d4a4444d4a
[ "MIT" ]
null
null
null
import config import logging import argparse import sys import csv from db import Vouchers, connect_db from sqlalchemy.orm import sessionmaker db=connect_db() #establish connection Session = sessionmaker(bind=db) session = Session() def importCSV(file, time): bulkInsert=[] keep={} csv.register_dialect('myDialec...
26.709677
95
0.694444
import config import logging import argparse import sys import csv from db import Vouchers, connect_db from sqlalchemy.orm import sessionmaker db=connect_db() Session = sessionmaker(bind=db) session = Session() def importCSV(file, time): bulkInsert=[] keep={} csv.register_dialect('myDialect', skipinitialsp...
true
true
1c387b91c5689545d6a13dcbc60bb9934ed15e83
890
py
Python
model.py
rahulkumar1112/Audio-Classification
589fccae5eeb9feaf04073b1243c0004759e3255
[ "MIT" ]
1
2019-06-21T14:43:48.000Z
2019-06-21T14:43:48.000Z
Example Audio and Deep Learning/model.py
felipegetulio/Artificial-Neural-Networks---Projects
04d16703ccc2fb10cc1ba92850364ea49b9a5bfa
[ "MIT" ]
null
null
null
Example Audio and Deep Learning/model.py
felipegetulio/Artificial-Neural-Networks---Projects
04d16703ccc2fb10cc1ba92850364ea49b9a5bfa
[ "MIT" ]
null
null
null
import os from scipy.io import wavfile import pandas as pd import matplotlib.pyplot as plt import numpy as np from keras.layers import Conv2D, MaxPool2D, Flatten, LSTM from keras.layers import Dropout, Dense, TimeDistributed from keras.models import Sequential from keras.utils import to_categorical from sklearn.utils.c...
29.666667
62
0.75618
import os from scipy.io import wavfile import pandas as pd import matplotlib.pyplot as plt import numpy as np from keras.layers import Conv2D, MaxPool2D, Flatten, LSTM from keras.layers import Dropout, Dense, TimeDistributed from keras.models import Sequential from keras.utils import to_categorical from sklearn.utils.c...
true
true
1c387d96bc457f3a14396ce1eafbcba911ab775e
2,317
py
Python
chapter9-็ฅž็ป็ฝ‘็ปœๅ†™่ฏ—(CharRNN)/utils.py
1364354238/PYTORCH_LEARNING
d7ab877512ab41c80b37ab68bd1a42193916f31c
[ "MIT" ]
137
2018-11-13T06:35:49.000Z
2022-03-07T09:21:31.000Z
chapter9_CharRNN/utils.py
pythonProjectLearn/PytorchLearning
835ce23656e5816f5fbc9018f85f8613bff8f24c
[ "MIT" ]
null
null
null
chapter9_CharRNN/utils.py
pythonProjectLearn/PytorchLearning
835ce23656e5816f5fbc9018f85f8613bff8f24c
[ "MIT" ]
54
2018-11-13T09:38:37.000Z
2022-03-25T03:46:25.000Z
#coding:utf8 import visdom import torch as t import time import torchvision as tv import numpy as np class Visualizer(): ''' ๅฐ่ฃ…ไบ†visdom็š„ๅŸบๆœฌๆ“ไฝœ๏ผŒไฝ†ๆ˜ฏไฝ ไป็„ถๅฏไปฅ้€š่ฟ‡`self.vis.function` ่ฐƒ็”จๅŽŸ็”Ÿ็š„visdomๆŽฅๅฃ ''' def __init__(self, env='default', **kwargs): import visdom self.vis = visdom.Visdom(env=env, *...
25.184783
63
0.475615
import visdom import torch as t import time import torchvision as tv import numpy as np class Visualizer(): def __init__(self, env='default', **kwargs): import visdom self.vis = visdom.Visdom(env=env, **kwargs) self.index = {} self.log_text = '' de...
true
true
1c387f54b5725f7f26862a550a12f20335f91984
2,542
py
Python
Generate battery report/Generate battery report.py
xinxin2021/my-projects
e2a95dff404c131c9795deea04829514a770e94d
[ "MIT" ]
null
null
null
Generate battery report/Generate battery report.py
xinxin2021/my-projects
e2a95dff404c131c9795deea04829514a770e94d
[ "MIT" ]
null
null
null
Generate battery report/Generate battery report.py
xinxin2021/my-projects
e2a95dff404c131c9795deea04829514a770e94d
[ "MIT" ]
null
null
null
# coding=utf-8 import os import wx def isi(path,name): file = os.listdir(path) if name in file: return True else: return False def isib(l,dx): for i in range(len(l)): if l[i] in dx: return False return True class MyFrame(wx.Frame): def __init_...
39.107692
192
0.560582
import os import wx def isi(path,name): file = os.listdir(path) if name in file: return True else: return False def isib(l,dx): for i in range(len(l)): if l[i] in dx: return False return True class MyFrame(wx.Frame): def __init__(self): ...
true
true
1c387f6af54f5ffd813b646aa95618c3133661bb
13,234
py
Python
mc/bookmarks/BookmarksTools.py
zy-sunshine/falkon-pyqt5
bc2b60aa21c9b136439bd57a11f391d68c736f99
[ "MIT" ]
1
2021-04-29T05:36:44.000Z
2021-04-29T05:36:44.000Z
mc/bookmarks/BookmarksTools.py
zy-sunshine/falkon-pyqt5
bc2b60aa21c9b136439bd57a11f391d68c736f99
[ "MIT" ]
1
2020-03-28T17:43:18.000Z
2020-03-28T17:43:18.000Z
mc/bookmarks/BookmarksTools.py
zy-sunshine/falkon-pyqt5
bc2b60aa21c9b136439bd57a11f391d68c736f99
[ "MIT" ]
1
2021-01-15T20:09:24.000Z
2021-01-15T20:09:24.000Z
from PyQt5.QtWidgets import QBoxLayout from PyQt5.QtWidgets import QDialog from PyQt5.QtWidgets import QDialogButtonBox from PyQt5.QtWidgets import QLabel from PyQt5.QtWidgets import QLineEdit from PyQt5.QtWidgets import QMenu from PyQt5.QtWidgets import QPushButton from PyQt5.Qt import pyqtSignal from PyQt5.Qt import ...
29.540179
108
0.610473
from PyQt5.QtWidgets import QBoxLayout from PyQt5.QtWidgets import QDialog from PyQt5.QtWidgets import QDialogButtonBox from PyQt5.QtWidgets import QLabel from PyQt5.QtWidgets import QLineEdit from PyQt5.QtWidgets import QMenu from PyQt5.QtWidgets import QPushButton from PyQt5.Qt import pyqtSignal from PyQt5.Qt import ...
true
true
1c387f79fe2cfc8681e3cba4788cfe8bebea297d
13,532
py
Python
funfact/lang/interpreter/test_type_deduction.py
campsd/FunFact
477bcf06794f09608240eba992823fae6fde8dad
[ "BSD-3-Clause-LBNL" ]
37
2021-09-22T17:28:35.000Z
2022-03-07T00:11:17.000Z
funfact/lang/interpreter/test_type_deduction.py
campsd/FunFact
477bcf06794f09608240eba992823fae6fde8dad
[ "BSD-3-Clause-LBNL" ]
125
2021-11-04T16:50:24.000Z
2022-03-28T17:54:13.000Z
funfact/lang/interpreter/test_type_deduction.py
campsd/FunFact
477bcf06794f09608240eba992823fae6fde8dad
[ "BSD-3-Clause-LBNL" ]
2
2021-12-13T07:28:42.000Z
2021-12-13T07:51:41.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- import pytest # noqa: F401 from unittest.mock import MagicMock as M from .._ast import Primitives as P from ._type_deduction import TypeDeducer, _add_attr @pytest.fixture def intr(): return TypeDeducer() def as_payload(live_indices, keep_indices, kron_indices, shap...
25.726236
79
0.381392
import pytest from unittest.mock import MagicMock as M from .._ast import Primitives as P from ._type_deduction import TypeDeducer, _add_attr @pytest.fixture def intr(): return TypeDeducer() def as_payload(live_indices, keep_indices, kron_indices, shape): return dict( live_indices=live_indices, ...
true
true
1c387fd94b6bfb20418bc9254eb731521eb4b65f
10,660
py
Python
vision/databunch.py
srujandeshpande/DashAI
85581abc17ff3a8bf03a1e8b6aae7a06e5ab0dc8
[ "Apache-2.0" ]
7
2020-08-26T09:36:54.000Z
2021-12-21T15:46:32.000Z
vision/databunch.py
JoeRishon/DashAI
68d1b01088a65e2062d96b47b083fa8f5c82b27c
[ "Apache-2.0" ]
16
2020-08-25T18:44:45.000Z
2022-03-25T19:12:36.000Z
vision/databunch.py
JoeRishon/DashAI
68d1b01088a65e2062d96b47b083fa8f5c82b27c
[ "Apache-2.0" ]
10
2020-09-30T19:27:17.000Z
2021-04-04T14:50:31.000Z
from fastai.vision import * from fastai.vision.gan import GANItemList from core.databunch import DashDatabunch from pathlib import Path class DashVisionDatabunch: def create_vision_databunch(response): path = Path('./') src = DashVisionDatabunch.get_itemlist(response) src = DashDatabunch.split_databunch(resp...
47.802691
155
0.679081
from fastai.vision import * from fastai.vision.gan import GANItemList from core.databunch import DashDatabunch from pathlib import Path class DashVisionDatabunch: def create_vision_databunch(response): path = Path('./') src = DashVisionDatabunch.get_itemlist(response) src = DashDatabunch.split_databunch(resp...
true
true
1c387ffffca64bd1c952d2445da2b5c5569fbcfc
2,406
py
Python
data/p4VQE/R1/benchmark/startQiskit61.py
UCLA-SEAL/QDiff
d968cbc47fe926b7f88b4adf10490f1edd6f8819
[ "BSD-3-Clause" ]
null
null
null
data/p4VQE/R1/benchmark/startQiskit61.py
UCLA-SEAL/QDiff
d968cbc47fe926b7f88b4adf10490f1edd6f8819
[ "BSD-3-Clause" ]
null
null
null
data/p4VQE/R1/benchmark/startQiskit61.py
UCLA-SEAL/QDiff
d968cbc47fe926b7f88b4adf10490f1edd6f8819
[ "BSD-3-Clause" ]
null
null
null
# qubit number=3 # total number=10 import numpy as np from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ import networkx as nx from qiskit.visualization import plot_histogram from typing import * from pprint import pprint from math import log2 from collectio...
27.033708
118
0.632585
import numpy as np from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ import networkx as nx from qiskit.visualization import plot_histogram from typing import * from pprint import pprint from math import log2 from collections import Counter from qiskit.tes...
true
true
1c388050475bd1bdb984e23752da29323d62e673
57,210
py
Python
test/engine/test_pool.py
hbusul/sqlalchemy
cd58836d3e19489d5203c02f7cc5f2f2d7c82a20
[ "MIT" ]
null
null
null
test/engine/test_pool.py
hbusul/sqlalchemy
cd58836d3e19489d5203c02f7cc5f2f2d7c82a20
[ "MIT" ]
null
null
null
test/engine/test_pool.py
hbusul/sqlalchemy
cd58836d3e19489d5203c02f7cc5f2f2d7c82a20
[ "MIT" ]
null
null
null
import collections import random import threading import time import weakref import sqlalchemy as tsa from sqlalchemy import event from sqlalchemy import pool from sqlalchemy import select from sqlalchemy import testing from sqlalchemy.engine import default from sqlalchemy.pool.impl import _AsyncConnDialect from sqlal...
28.251852
79
0.571474
import collections import random import threading import time import weakref import sqlalchemy as tsa from sqlalchemy import event from sqlalchemy import pool from sqlalchemy import select from sqlalchemy import testing from sqlalchemy.engine import default from sqlalchemy.pool.impl import _AsyncConnDialect from sqlal...
true
true
1c38810df10e266c92d99bb8419da6c328ffd0d1
948
py
Python
examples/swat-s1/run.py
pgaulon/minicps
f3b873e00f477d8b5c36fcb7df3d1cfe27063822
[ "MIT" ]
119
2015-10-16T22:47:39.000Z
2022-03-31T07:18:00.000Z
examples/swat-s1/run.py
DolphinWilly/minicps
7400f85e47d09901bb702966abf557244cf11ce4
[ "MIT" ]
20
2016-09-30T06:18:39.000Z
2022-03-11T10:51:33.000Z
examples/swat-s1/run.py
DolphinWilly/minicps
7400f85e47d09901bb702966abf557244cf11ce4
[ "MIT" ]
65
2016-07-27T03:50:39.000Z
2022-03-05T14:49:17.000Z
""" swat-s1 run.py """ from mininet.net import Mininet from mininet.cli import CLI from minicps.mcps import MiniCPS from topo import SwatTopo import sys class SwatS1CPS(MiniCPS): """Main container used to run the simulation.""" def __init__(self, name, net): self.name = name self.net = n...
18.96
57
0.580169
from mininet.net import Mininet from mininet.cli import CLI from minicps.mcps import MiniCPS from topo import SwatTopo import sys class SwatS1CPS(MiniCPS): def __init__(self, name, net): self.name = name self.net = net net.start() net.pingAll() plc1, plc2,...
true
true
1c3881223c1ee0b542cb5cb12e20136c58a24464
6,582
py
Python
pyOCD/target/target_MK22FN1M0Axxx12.py
orenc17/pyOCD
b5c9bc62b68323129aa258e128a8fc68aaa2527f
[ "Apache-2.0" ]
1
2018-10-30T12:47:34.000Z
2018-10-30T12:47:34.000Z
pyOCD/target/target_MK22FN1M0Axxx12.py
orenc17/pyOCD
b5c9bc62b68323129aa258e128a8fc68aaa2527f
[ "Apache-2.0" ]
null
null
null
pyOCD/target/target_MK22FN1M0Axxx12.py
orenc17/pyOCD
b5c9bc62b68323129aa258e128a8fc68aaa2527f
[ "Apache-2.0" ]
1
2021-02-04T10:05:57.000Z
2021-02-04T10:05:57.000Z
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2013 ARM Limited 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 ...
56.25641
101
0.762078
from .family.target_kinetis import Kinetis from .family.flash_kinetis import Flash_Kinetis from ..core.memory_map import (FlashRegion, RamRegion, MemoryMap) from ..debug.svd import SVDFile import logging SIM_FCFG1 = 0x4004804C SIM_FCFG2 = 0x40048050 SIM_FCFG2_PFLSH = (1 << 23) flash_algo = { 'load_address' : 0x2...
true
true
1c38824e94a12bf48e5da200097fda8c47173733
4,662
py
Python
pynmrstar/utils.py
bmrb-io/PyNMRSTAR
55df5bf7de192e7a6c95f37e0756f09e3f504170
[ "MIT" ]
1
2022-03-07T16:10:56.000Z
2022-03-07T16:10:56.000Z
pynmrstar/utils.py
bmrb-io/PyNMRSTAR
55df5bf7de192e7a6c95f37e0756f09e3f504170
[ "MIT" ]
2
2021-10-29T19:25:56.000Z
2022-02-28T11:05:44.000Z
pynmrstar/utils.py
bmrb-io/PyNMRSTAR
55df5bf7de192e7a6c95f37e0756f09e3f504170
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 """ This file contains various helper functions.""" import functools import json import os from typing import Iterable, Any, Dict from urllib.error import HTTPError, URLError from pynmrstar import definitions, cnmrstar, entry as entry_mod from pynmrstar._internal import _interpret_file from pyn...
34.533333
112
0.682754
import functools import json import os from typing import Iterable, Any, Dict from urllib.error import HTTPError, URLError from pynmrstar import definitions, cnmrstar, entry as entry_mod from pynmrstar._internal import _interpret_file from pynmrstar.schema import Schema __all__ = ['diff', 'format_category', 'forma...
true
true
1c38828042952d710c0ec220f1f9afaa869a649e
867
py
Python
src/east_coast_images/plot_ratios.py
slawler/SI_2019_Coastal
4064d323bc62ce2f47a7af41b9a11ea5538ad181
[ "MIT" ]
1
2020-03-13T07:51:44.000Z
2020-03-13T07:51:44.000Z
src/east_coast_images/plot_ratios.py
cheginit/SI_2019_Coastal
4064d323bc62ce2f47a7af41b9a11ea5538ad181
[ "MIT" ]
null
null
null
src/east_coast_images/plot_ratios.py
cheginit/SI_2019_Coastal
4064d323bc62ce2f47a7af41b9a11ea5538ad181
[ "MIT" ]
1
2020-03-13T14:44:57.000Z
2020-03-13T14:44:57.000Z
import pandas as pd from pathlib import Path from geopy import distance import utils data = pd.read_csv('shape_data.csv') left = data.loc[data.Lon.idxmin(), ['Lat', 'Lon']] data['Distance'] = data.apply(lambda x: distance.geodesic(left, (x['Lat'], x['Lon'])).km, axis=1) trap = data.loc[data.Shape == 'trapezoid', ['L...
39.409091
97
0.655133
import pandas as pd from pathlib import Path from geopy import distance import utils data = pd.read_csv('shape_data.csv') left = data.loc[data.Lon.idxmin(), ['Lat', 'Lon']] data['Distance'] = data.apply(lambda x: distance.geodesic(left, (x['Lat'], x['Lon'])).km, axis=1) trap = data.loc[data.Shape == 'trapezoid', ['L...
true
true
1c3882f3bd53fbe4847ffeb09fc5be3a48d29384
19,644
py
Python
ambari-server/src/test/python/stacks/1.3.2/MAPREDUCE/test_mapreduce_jobtracker.py
vsosrc/ambari
e3cc898672707bedf7597f2e16d684c8a00bba3b
[ "Apache-2.0" ]
null
null
null
ambari-server/src/test/python/stacks/1.3.2/MAPREDUCE/test_mapreduce_jobtracker.py
vsosrc/ambari
e3cc898672707bedf7597f2e16d684c8a00bba3b
[ "Apache-2.0" ]
null
null
null
ambari-server/src/test/python/stacks/1.3.2/MAPREDUCE/test_mapreduce_jobtracker.py
vsosrc/ambari
e3cc898672707bedf7597f2e16d684c8a00bba3b
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python ''' 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")...
47.33494
194
0.49888
''' 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 use thi...
false
true
1c388316514f753f1f2f8589d28db201efa18df7
5,330
py
Python
test/IECoreImage/DisplayDriverServerTest.py
andrewkaufman/cortex
23f893c3c0c92ec1842e3946f9654ff91f40aa67
[ "BSD-3-Clause" ]
null
null
null
test/IECoreImage/DisplayDriverServerTest.py
andrewkaufman/cortex
23f893c3c0c92ec1842e3946f9654ff91f40aa67
[ "BSD-3-Clause" ]
null
null
null
test/IECoreImage/DisplayDriverServerTest.py
andrewkaufman/cortex
23f893c3c0c92ec1842e3946f9654ff91f40aa67
[ "BSD-3-Clause" ]
null
null
null
########################################################################## # # Copyright (c) 2016, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
44.789916
148
0.732645
true
true
1c38834865037be0126926c49cc1add3c763f20d
3,852
py
Python
ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/dhcp6iana6_7939c0233bac17c3e3764bc9bc1a9571.py
OpenIxia/ixnetwork_restpy
f628db450573a104f327cf3c737ca25586e067ae
[ "MIT" ]
20
2019-05-07T01:59:14.000Z
2022-02-11T05:24:47.000Z
ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/dhcp6iana6_7939c0233bac17c3e3764bc9bc1a9571.py
OpenIxia/ixnetwork_restpy
f628db450573a104f327cf3c737ca25586e067ae
[ "MIT" ]
60
2019-04-03T18:59:35.000Z
2022-02-22T12:05:05.000Z
ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/dhcp6iana6_7939c0233bac17c3e3764bc9bc1a9571.py
OpenIxia/ixnetwork_restpy
f628db450573a104f327cf3c737ca25586e067ae
[ "MIT" ]
13
2019-05-20T10:48:31.000Z
2021-10-06T07:45:44.000Z
# MIT LICENSE # # Copyright 1997 - 2020 by IXIA Keysight # # 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,...
35.33945
145
0.660696
from ixnetwork_restpy.base import Base from ixnetwork_restpy.files import Files from typing import List, Any, Union class Dhcp6Iana6(Base): __slots__ = () _SDM_NAME = 'dhcp6Iana6' _SDM_ATT_MAP = { 'Count': 'count', 'DescriptiveName': 'descriptiveName', 'Name':...
true
true
1c3883ecedd095bf376a4526f985caa975a29924
38,335
py
Python
tests/test_tools.py
raidun99/regolith
ad4af42023d6133d18b0ef8aac7f3ef7aa5c1693
[ "CC0-1.0" ]
null
null
null
tests/test_tools.py
raidun99/regolith
ad4af42023d6133d18b0ef8aac7f3ef7aa5c1693
[ "CC0-1.0" ]
null
null
null
tests/test_tools.py
raidun99/regolith
ad4af42023d6133d18b0ef8aac7f3ef7aa5c1693
[ "CC0-1.0" ]
null
null
null
import pytest import datetime as dt from regolith.tools import ( filter_publications, fuzzy_retrieval, fragment_retrieval, number_suffix, latex_safe, update_schemas, merge_collections, group, is_fully_appointed, group_member_ids, group_member_employment_start_end, month_a...
39.197342
150
0.481753
import pytest import datetime as dt from regolith.tools import ( filter_publications, fuzzy_retrieval, fragment_retrieval, number_suffix, latex_safe, update_schemas, merge_collections, group, is_fully_appointed, group_member_ids, group_member_employment_start_end, month_a...
true
true
1c38840516f5d7445dc6d7a99403e818a10956dd
2,932
py
Python
osim-rl/examples/arm.py
lancerane/NIPS-2018-AI-for-Prosthetics
7689646e2d079ffcbcde898ece25d2cf78c132c7
[ "MIT" ]
3
2019-04-01T10:14:04.000Z
2022-02-16T07:15:49.000Z
osim-rl/examples/arm.py
lancerane/NIPS-2018-AI-for-Prosthetics
7689646e2d079ffcbcde898ece25d2cf78c132c7
[ "MIT" ]
1
2019-07-10T07:57:48.000Z
2019-07-11T07:41:43.000Z
osim-rl/examples/arm.py
lancerane/NIPS-2018-AI-for-Prosthetics
7689646e2d079ffcbcde898ece25d2cf78c132c7
[ "MIT" ]
3
2019-05-12T09:41:00.000Z
2021-11-03T20:54:36.000Z
import os from osim.env import OsimEnv import pprint import numpy as np class Arm3dEnv(OsimEnv): model_path = os.path.join(os.path.dirname(__file__), '../osim/models/MoBL_ARMS_J_Simple_032118.osim') time_limit = 200 current_objective = np.array([0,0,0]) def is_done(self): # End ...
35.756098
138
0.596862
import os from osim.env import OsimEnv import pprint import numpy as np class Arm3dEnv(OsimEnv): model_path = os.path.join(os.path.dirname(__file__), '../osim/models/MoBL_ARMS_J_Simple_032118.osim') time_limit = 200 current_objective = np.array([0,0,0]) def is_done(self): ...
true
true
1c38844a25ec5660e773058dc22758b3ba1914bf
446
py
Python
src/lolite/lib/hooks/Python3Script.py
NathanKewley/lolite
f3d6cd07e9893bbb6b923d49ecb8681cd218eace
[ "Apache-2.0" ]
5
2021-05-04T06:07:43.000Z
2021-12-11T15:08:01.000Z
src/lolite/lib/hooks/Python3Script.py
NathanKewley/lolite
f3d6cd07e9893bbb6b923d49ecb8681cd218eace
[ "Apache-2.0" ]
4
2021-05-01T07:20:21.000Z
2021-05-29T04:51:56.000Z
src/lolite/lib/hooks/Python3Script.py
NathanKewley/lolite
f3d6cd07e9893bbb6b923d49ecb8681cd218eace
[ "Apache-2.0" ]
null
null
null
from lolite.lib.hooks.hook_base import HookBase class Hook(HookBase): def __init__(self, logger, arguments): super().__init__(logger, arguments) def execute_hook(self): self._logger.debug(f"Running Python3 Hook: {self._arguments}") if not self._subproc.run_command_exit_co...
31.857143
87
0.674888
from lolite.lib.hooks.hook_base import HookBase class Hook(HookBase): def __init__(self, logger, arguments): super().__init__(logger, arguments) def execute_hook(self): self._logger.debug(f"Running Python3 Hook: {self._arguments}") if not self._subproc.run_command_exit_co...
true
true
1c38844fce8820095626484dad3f69c9e1319288
24,888
py
Python
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_mpls_vpn_oper.py
bopopescu/ACI
dd717bc74739eeed4747b3ea9e36b239580df5e1
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_mpls_vpn_oper.py
bopopescu/ACI
dd717bc74739eeed4747b3ea9e36b239580df5e1
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_mpls_vpn_oper.py
bopopescu/ACI
dd717bc74739eeed4747b3ea9e36b239580df5e1
[ "ECL-2.0", "Apache-2.0" ]
1
2020-07-22T04:04:44.000Z
2020-07-22T04:04:44.000Z
""" Cisco_IOS_XR_mpls_vpn_oper This module contains a collection of YANG definitions for Cisco IOS\-XR mpls\-vpn package operational data. This module contains definitions for the following management objects\: l3vpn\: L3VPN operational data Copyright (c) 2013\-2017 by Cisco Systems, Inc. All rights reserved. ""...
36.069565
175
0.499879
from collections import OrderedDict from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64 from ydk.filters import YFilter from ydk.errors import YError, YModelError from ydk.errors.error_handler import handle_type_error as _handle_type_error cl...
true
true
1c3884b2e21c9416d76a3ae7f7dfa9fe00146e26
4,127
py
Python
application/aci/models.py
HyechurnJang/archon
2cda56436ed6dea65d38774f7c9ed6c3315dbc03
[ "Apache-2.0" ]
1
2018-03-07T08:33:23.000Z
2018-03-07T08:33:23.000Z
application/aci/models.py
HyechurnJang/archon
2cda56436ed6dea65d38774f7c9ed6c3315dbc03
[ "Apache-2.0" ]
2
2017-03-14T01:02:55.000Z
2017-03-14T01:07:29.000Z
application/aci/models.py
HyechurnJang/archon
2cda56436ed6dea65d38774f7c9ed6c3315dbc03
[ "Apache-2.0" ]
4
2017-02-03T04:53:07.000Z
2020-04-20T07:52:47.000Z
# -*- coding: utf-8 -*- ################################################################################ # _____ _ _____ _ # # / ____(_) / ____| | | # # | | _ ___ ___ ___ | (___ _ _ ___| |_...
53.597403
80
0.388902
d(max_length=100) dn = models.CharField(max_length=2048) intf = models.CharField(max_length=2048) start = models.CharField(max_length=24) stop = models.CharField(max_length=24) modelview(EPTracker) class FaultMessage(models.Model): code = models.CharField(max_length=8) title = models.CharFiel...
true
true
1c3885a735d8c4e6f62f1bac47fb74426f809a4d
1,141
py
Python
lib/systems/d-arabinose.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
lib/systems/d-arabinose.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
lib/systems/d-arabinose.py
pulsar-chem/BPModule
f8e64e04fdb01947708f098e833600c459c2ff0e
[ "BSD-3-Clause" ]
null
null
null
import pulsar as psr def load_ref_system(): """ Returns d-arabinose as found in the IQMol fragment library. All credit to https://github.com/nutjunkie/IQmol """ return psr.make_system(""" C 2.3481 -0.9668 0.1807 C 1.2791 0.0840 -0.2072 C -0.161...
40.75
67
0.405784
import pulsar as psr def load_ref_system(): return psr.make_system(""" C 2.3481 -0.9668 0.1807 C 1.2791 0.0840 -0.2072 C -0.1614 -0.4732 0.0020 C -1.2259 0.6349 -0.2676 C -2.5511 -0.0222 -0.6508 O ...
true
true
1c38875a7a77a091f468124bf60e54b52c488fe7
19,102
py
Python
train_180215_1_Dense_6th_training.py
OsciiArt/Cookpad
b2245f84db0650d6282c97c98600de825c6ed6e0
[ "MIT" ]
null
null
null
train_180215_1_Dense_6th_training.py
OsciiArt/Cookpad
b2245f84db0650d6282c97c98600de825c6ed6e0
[ "MIT" ]
null
null
null
train_180215_1_Dense_6th_training.py
OsciiArt/Cookpad
b2245f84db0650d6282c97c98600de825c6ed6e0
[ "MIT" ]
null
null
null
import numpy as np # linear algebra np.random.seed(42) import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) from sklearn.model_selection import train_test_split from matplotlib import pyplot import time import os, glob import cv2 # parameters format = "%H%M" ts = time.strftime(format) base_name = os....
34.418018
166
0.58753
import numpy as np np.random.seed(42) import pandas as pd from sklearn.model_selection import train_test_split from matplotlib import pyplot import time import os, glob import cv2 format = "%H%M" ts = time.strftime(format) base_name = os.path.splitext(__file__)[0] + "_ts" + ts input_size = 221 from keras.preproce...
true
true
1c388762cb270cccc694c3cc35eec77a5c2a4523
8,129
py
Python
opencood/loss/fpvrcnn_loss.py
YuanYunshuang/OpenCOOD
98e07eb45f7fdcd32518b2cf8f9052f73ca80bec
[ "Apache-2.0" ]
null
null
null
opencood/loss/fpvrcnn_loss.py
YuanYunshuang/OpenCOOD
98e07eb45f7fdcd32518b2cf8f9052f73ca80bec
[ "Apache-2.0" ]
null
null
null
opencood/loss/fpvrcnn_loss.py
YuanYunshuang/OpenCOOD
98e07eb45f7fdcd32518b2cf8f9052f73ca80bec
[ "Apache-2.0" ]
null
null
null
import torch from torch import nn import numpy as np from opencood.loss.ciassd_loss import CiassdLoss, weighted_smooth_l1_loss class FpvrcnnLoss(nn.Module): def __init__(self, args): super(FpvrcnnLoss, self).__init__() self.ciassd_loss = CiassdLoss(args['stage1']) self.cls = args['stage2']...
41.47449
111
0.559847
import torch from torch import nn import numpy as np from opencood.loss.ciassd_loss import CiassdLoss, weighted_smooth_l1_loss class FpvrcnnLoss(nn.Module): def __init__(self, args): super(FpvrcnnLoss, self).__init__() self.ciassd_loss = CiassdLoss(args['stage1']) self.cls = args['stage2']...
true
true
1c38885b0dc3ff66a8b79b9298a5f9ff6c7bc340
48,337
py
Python
pythoms/mzml.py
flowerah/PythoMS
7d500f20219157657023c8c0a930f580d3768191
[ "MIT" ]
null
null
null
pythoms/mzml.py
flowerah/PythoMS
7d500f20219157657023c8c0a930f580d3768191
[ "MIT" ]
null
null
null
pythoms/mzml.py
flowerah/PythoMS
7d500f20219157657023c8c0a930f580d3768191
[ "MIT" ]
null
null
null
""" IGNORE: CHANGELOG: - ---2.7 building to add: try to extract timepoints and tic from chromatogramList (x values are sorted, so this probably won't work) IGNORE """ import sys import os import zlib import gzip import base64 import struct import subprocess import xml.dom.minidom import scipy as sci from random im...
45.515066
175
0.596148
import sys import os import zlib import gzip import base64 import struct import subprocess import xml.dom.minidom import scipy as sci from random import random from .progress import Progress from .spectrum import Spectrum from .psims import CVParameterSet, stringtodigit from .tome import resolution, locate_in_list, tri...
true
true
1c3888f0cf285a3a0076e254a6838bcd4e5d38db
451
py
Python
src/posts/migrations/0002_post_section.py
kelchidoo/financezone
0b16179b6028ef061a21b5003bbaffe18db8459e
[ "MIT" ]
null
null
null
src/posts/migrations/0002_post_section.py
kelchidoo/financezone
0b16179b6028ef061a21b5003bbaffe18db8459e
[ "MIT" ]
null
null
null
src/posts/migrations/0002_post_section.py
kelchidoo/financezone
0b16179b6028ef061a21b5003bbaffe18db8459e
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-08-05 19:13 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('posts', '0001_initial'), ] operations = [ migrations.AddField( ...
21.47619
65
0.609756
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('posts', '0001_initial'), ] operations = [ migrations.AddField( model_name='post', name='section', field=models...
true
true
1c388a6c6859d6e68629d021830a224fc96d1d4f
773
py
Python
tests/test_font_size.py
ehtec/pdfminer.six
5b1823f25ab998e904fc5d81687732580f23e3b9
[ "MIT" ]
null
null
null
tests/test_font_size.py
ehtec/pdfminer.six
5b1823f25ab998e904fc5d81687732580f23e3b9
[ "MIT" ]
1
2022-01-31T22:58:07.000Z
2022-01-31T22:58:07.000Z
tests/test_font_size.py
phantomcyber/pdfminer.six
e35a9319a6ae5d310f08f07a5edf16aadc529c1e
[ "MIT" ]
null
null
null
from helpers import absolute_sample_path from pdfminer.high_level import extract_pages from pdfminer.layout import LTChar, LTTextBox def test_font_size(): path = absolute_sample_path('font-size-test.pdf') for page in extract_pages(path): for text_box in page: if isinstance(text_box, LTText...
38.65
67
0.570505
from helpers import absolute_sample_path from pdfminer.high_level import extract_pages from pdfminer.layout import LTChar, LTTextBox def test_font_size(): path = absolute_sample_path('font-size-test.pdf') for page in extract_pages(path): for text_box in page: if isinstance(text_box, LTText...
true
true
1c388b2613d1ec6add292ddb344c67ba4bb59a48
256
py
Python
configs/unet/fcn_unet_s5-d16_256x256_40k_hrf.py
Xlinford/mmsegmentation
8b444de5e6db2af2538a73a93ac75204f5c3bb2f
[ "Apache-2.0" ]
null
null
null
configs/unet/fcn_unet_s5-d16_256x256_40k_hrf.py
Xlinford/mmsegmentation
8b444de5e6db2af2538a73a93ac75204f5c3bb2f
[ "Apache-2.0" ]
null
null
null
configs/unet/fcn_unet_s5-d16_256x256_40k_hrf.py
Xlinford/mmsegmentation
8b444de5e6db2af2538a73a93ac75204f5c3bb2f
[ "Apache-2.0" ]
null
null
null
_base_ = [ '../_base_/models/fcn_unet_s5-d16.py', '../_base_/datasets/hrf.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] test_cfg = dict(crop_size=(256, 256), stride=(170, 170)) evaluation = dict(metric='mDice')
36.571429
74
0.660156
_base_ = [ '../_base_/models/fcn_unet_s5-d16.py', '../_base_/datasets/hrf.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py' ] test_cfg = dict(crop_size=(256, 256), stride=(170, 170)) evaluation = dict(metric='mDice')
true
true
1c388b552035a4b9b2ec413e86da8a0c41e5beb0
3,731
py
Python
bw2io/extractors/exiobase.py
mfastudillo/brightway2-io
dc383ddb6003a46e78259aeb7f87b9d80965d689
[ "BSD-3-Clause" ]
null
null
null
bw2io/extractors/exiobase.py
mfastudillo/brightway2-io
dc383ddb6003a46e78259aeb7f87b9d80965d689
[ "BSD-3-Clause" ]
null
null
null
bw2io/extractors/exiobase.py
mfastudillo/brightway2-io
dc383ddb6003a46e78259aeb7f87b9d80965d689
[ "BSD-3-Clause" ]
null
null
null
from pathlib import Path from tqdm import tqdm import csv import os import re def remove_numerics(string): """Transform names like 'Tobacco products (16)' into 'Tobacco products'""" return re.sub(r" \(\d\d\)$", "", string) class Exiobase3DataExtractor(object): @classmethod def _check_dir(cls, path):...
33.918182
88
0.5197
from pathlib import Path from tqdm import tqdm import csv import os import re def remove_numerics(string): return re.sub(r" \(\d\d\)$", "", string) class Exiobase3DataExtractor(object): @classmethod def _check_dir(cls, path): assert os.path.isdir(path), "Must supply path to EXIOBASE dat...
true
true
1c388bae3fb6fc165c920da9ecd9a70d511f6b52
1,188
py
Python
src/gui/mixins.py
dynaryu/vaws
f6ed9b75408f7ce6100ed59b7754f745e59be152
[ "BSD-3-Clause" ]
null
null
null
src/gui/mixins.py
dynaryu/vaws
f6ed9b75408f7ce6100ed59b7754f745e59be152
[ "BSD-3-Clause" ]
null
null
null
src/gui/mixins.py
dynaryu/vaws
f6ed9b75408f7ce6100ed59b7754f745e59be152
[ "BSD-3-Clause" ]
null
null
null
from PyQt4.QtCore import QVariant, QSettings from PyQt4.QtGui import QTableWidget class PersistSizePosMixin(object): def __init__(self, name): self.name = name def initSizePosFromSettings(self): settings = QSettings() key = self.name + "/Geometry" if setting...
33
82
0.632155
from PyQt4.QtCore import QVariant, QSettings from PyQt4.QtGui import QTableWidget class PersistSizePosMixin(object): def __init__(self, name): self.name = name def initSizePosFromSettings(self): settings = QSettings() key = self.name + "/Geometry" if setting...
true
true
1c388c7ef1bcb9c97ba3d2d40f8d2d79a492e919
20,373
py
Python
azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/zones_operations.py
alexeldeib/azure-sdk-for-python
eed1e228847d90d97ca55ded98e10a915b391b61
[ "MIT" ]
1
2018-07-23T08:59:24.000Z
2018-07-23T08:59:24.000Z
azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/zones_operations.py
Vinaysaibhogela/azure-sdk-for-python
3345c2b5ed2b750024f71331a68d7a087157e9a7
[ "MIT" ]
null
null
null
azure-mgmt-dns/azure/mgmt/dns/v2016_04_01/operations/zones_operations.py
Vinaysaibhogela/azure-sdk-for-python
3345c2b5ed2b750024f71331a68d7a087157e9a7
[ "MIT" ]
null
null
null
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
46.407745
169
0.653659
import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling from .. import models class ZonesOperations(object): models = models def __init__(s...
true
true
1c388e1b43dc8a50c0ebf84601ad29804106cc77
1,171
py
Python
sktime/utils/seasonality.py
Mo-Saif/sktime
f3c71977c113d986276fca2bdedf70faaa33f040
[ "BSD-3-Clause" ]
1
2019-09-29T07:11:33.000Z
2019-09-29T07:11:33.000Z
sktime/utils/seasonality.py
ClaudiaSanches/sktime
63e7839e80ca6d5fe5fc4f33389ec3bcacd8aa59
[ "BSD-3-Clause" ]
null
null
null
sktime/utils/seasonality.py
ClaudiaSanches/sktime
63e7839e80ca6d5fe5fc4f33389ec3bcacd8aa59
[ "BSD-3-Clause" ]
1
2019-05-08T10:42:20.000Z
2019-05-08T10:42:20.000Z
from statsmodels.tsa.stattools import acf import numpy as np def seasonality_test(x, freq): """Seasonality test used in M4 competition # original implementation # def seasonality_test(original_ts, ppy): # # Seasonality test # :param original_ts: time series # :param ppy: periods per year ...
23.42
76
0.577284
from statsmodels.tsa.stattools import acf import numpy as np def seasonality_test(x, freq): x = np.asarray(x) crit_val = 1.645 n = len(x) r = acf(x, nlags=freq) s = r[1] + np.sum(r[2:] ** 2) limit = crit_val * np.sqrt((1 + 2 * s) / n) return np.abs(r[freq]) > limit
true
true
1c388eed2ac49e4f17d0ea70be50fbca14318c10
17,392
py
Python
pythonforandroid/bootstrap.py
mishk/python-for-android
1b887bed09a7ec19bfa00c9fb69a54e3f60a2328
[ "MIT" ]
2
2020-09-18T17:14:12.000Z
2021-03-24T11:39:12.000Z
pythonforandroid/bootstrap.py
mishk/python-for-android
1b887bed09a7ec19bfa00c9fb69a54e3f60a2328
[ "MIT" ]
null
null
null
pythonforandroid/bootstrap.py
mishk/python-for-android
1b887bed09a7ec19bfa00c9fb69a54e3f60a2328
[ "MIT" ]
1
2020-07-23T02:40:40.000Z
2020-07-23T02:40:40.000Z
import functools import glob import importlib import os from os.path import (join, dirname, isdir, normpath, splitext, basename) from os import listdir, walk, sep import sh import shlex import shutil from pythonforandroid.logger import (shprint, info, logger, debug) from pythonforandroid.util import ( current_dire...
39.259594
110
0.594181
import functools import glob import importlib import os from os.path import (join, dirname, isdir, normpath, splitext, basename) from os import listdir, walk, sep import sh import shlex import shutil from pythonforandroid.logger import (shprint, info, logger, debug) from pythonforandroid.util import ( current_dire...
true
true
1c388f83b0135bdf4b3681bd6fab412577e4207e
3,528
py
Python
testsite/settings.py
deepaksingh1/testsite
a36737f49d6264c0c38f7b8c4b96de248e8e3f41
[ "MIT" ]
null
null
null
testsite/settings.py
deepaksingh1/testsite
a36737f49d6264c0c38f7b8c4b96de248e8e3f41
[ "MIT" ]
null
null
null
testsite/settings.py
deepaksingh1/testsite
a36737f49d6264c0c38f7b8c4b96de248e8e3f41
[ "MIT" ]
null
null
null
""" Django settings for testsite project. Generated by 'django-admin startproject' using Django 3.0.1. For more information on this file, see https://docs.djangoproject.com/en/3.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os ...
24.5
91
0.694728
import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = '_)@s9t+_-xj-0v&-@o1u8pzv53)idi&+jym4)9@g#42-oa(5il' DEBUG = True ALLOWED_HOSTS = ['http://deepaks135.pythonanywhere.com'] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.cont...
true
true
1c38903631724b2f4bcc64d6a35b37d5295b7e23
1,576
py
Python
pandas/tests/indexes/base_class/test_indexing.py
advatar/pandas
14b84b45d6c891fd8954ba9bb0c493cd9ec2a662
[ "PSF-2.0", "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "MIT", "ECL-2.0", "BSD-3-Clause" ]
1
2021-01-14T15:16:34.000Z
2021-01-14T15:16:34.000Z
pandas/tests/indexes/base_class/test_indexing.py
Tian-Jionglu/pandas
6b3618de9c5deae3bcb4c7d5dfbd35e1f9eeaf15
[ "PSF-2.0", "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "MIT", "ECL-2.0", "BSD-3-Clause" ]
null
null
null
pandas/tests/indexes/base_class/test_indexing.py
Tian-Jionglu/pandas
6b3618de9c5deae3bcb4c7d5dfbd35e1f9eeaf15
[ "PSF-2.0", "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "MIT", "ECL-2.0", "BSD-3-Clause" ]
null
null
null
import numpy as np import pytest from pandas.compat import is_numpy_dev from pandas import Index import pandas._testing as tm class TestGetSliceBounds: @pytest.mark.parametrize("kind", ["getitem", "loc", None]) @pytest.mark.parametrize("side, expected", [("left", 4), ("right", 5)]) def test_get_slice_bo...
39.4
85
0.673223
import numpy as np import pytest from pandas.compat import is_numpy_dev from pandas import Index import pandas._testing as tm class TestGetSliceBounds: @pytest.mark.parametrize("kind", ["getitem", "loc", None]) @pytest.mark.parametrize("side, expected", [("left", 4), ("right", 5)]) def test_get_slice_bo...
true
true
1c3893b343a7fc290d6d36d72be638b7ffade06e
1,943
py
Python
astropy/sphinx/ext/tests/test_automodsumm.py
xiaomi1122/astropy
8876e902f5efa02a3fc27d82fe15c16001d4df5e
[ "BSD-3-Clause" ]
null
null
null
astropy/sphinx/ext/tests/test_automodsumm.py
xiaomi1122/astropy
8876e902f5efa02a3fc27d82fe15c16001d4df5e
[ "BSD-3-Clause" ]
null
null
null
astropy/sphinx/ext/tests/test_automodsumm.py
xiaomi1122/astropy
8876e902f5efa02a3fc27d82fe15c16001d4df5e
[ "BSD-3-Clause" ]
null
null
null
# Licensed under a 3-clause BSD style license - see LICENSE.rst from ....tests.helper import pytest pytest.importorskip('sphinx') # skips these tests if sphinx not present class FakeEnv(object): """ Mocks up a sphinx env setting construct for automodapi tests """ def __init__(self, **kwargs): ...
26.986111
75
0.687597
from ....tests.helper import pytest pytest.importorskip('sphinx') class FakeEnv(object): def __init__(self, **kwargs): for k, v in kwargs.iteritems(): setattr(self, k, v) class FakeBuilder(object): def __init__(self, **kwargs): self.env = FakeEnv(**kwargs) class FakeApp(obje...
true
true
1c3894096729807804f491952c37d47fec2bd279
3,209
py
Python
stock/models.py
Singosgu/Elvis_WMS
e6911b7daae76be640ece8946104af24b6cf0fa6
[ "MIT" ]
3
2020-10-19T05:55:28.000Z
2020-11-12T03:55:06.000Z
stock/models.py
Singosgu/Django_WMS
8cf5f5282a5619d6f488372020f95441cf89f868
[ "MIT" ]
1
2020-07-24T07:34:36.000Z
2020-07-24T07:34:36.000Z
stock/models.py
Singosgu/Elvis_WMS
e6911b7daae76be640ece8946104af24b6cf0fa6
[ "MIT" ]
4
2020-09-04T13:35:15.000Z
2020-10-16T15:10:38.000Z
from django.db import models class StockListModel(models.Model): goods_code = models.CharField(max_length=32, verbose_name="Goods Code") goods_desc = models.CharField(max_length=255, verbose_name="Goods Description") goods_qty = models.BigIntegerField(default=0, verbose_name="Total Qty") onhand_stock =...
56.298246
104
0.747897
from django.db import models class StockListModel(models.Model): goods_code = models.CharField(max_length=32, verbose_name="Goods Code") goods_desc = models.CharField(max_length=255, verbose_name="Goods Description") goods_qty = models.BigIntegerField(default=0, verbose_name="Total Qty") onhand_stock =...
true
true
1c38941befd420085bd5935ca9e675d2d2bbcea6
7,359
py
Python
caserec/recommenders/item_recommendation/item_attribute_knn.py
eduardofressato/CaseRecommender
0e5675f3afdb14111b14e02a511527647b66aa66
[ "MIT" ]
1
2019-01-05T02:14:47.000Z
2019-01-05T02:14:47.000Z
caserec/recommenders/item_recommendation/item_attribute_knn.py
guedes-joaofelipe/CaseRecommender
5606db93f0296d0b9b5eeaba2bd48787c5ff5625
[ "MIT" ]
null
null
null
caserec/recommenders/item_recommendation/item_attribute_knn.py
guedes-joaofelipe/CaseRecommender
5606db93f0296d0b9b5eeaba2bd48787c5ff5625
[ "MIT" ]
null
null
null
# coding=utf-8 """" Item Based Collaborative Filtering Recommender with Attributes (Item Attribute KNN) [Item Recommendation (Ranking)] Its philosophy is as follows: in order to determine the rating of User u on item m, we can find other movies that are similar to item m, and based on User uโ€™s ratings ...
45.99375
120
0.655524
from collections import defaultdict import numpy as np from caserec.recommenders.item_recommendation.itemknn import ItemKNN from caserec.utils.process_data import ReadFile __author__ = 'Arthur Fortes <fortes.arthur@gmail.com>' class ItemAttributeKNN(ItemKNN): def __init__(self, train_file=None, test_file=No...
true
true
1c38942cb70c69cf580c8bc3fbbe42ea9fe08095
302
py
Python
test/test_kind_section.py
JianxingHuang/ecint
4c41d9d7c77ee85dd3af69aa0999d093b6a8c7a3
[ "MIT" ]
null
null
null
test/test_kind_section.py
JianxingHuang/ecint
4c41d9d7c77ee85dd3af69aa0999d093b6a8c7a3
[ "MIT" ]
null
null
null
test/test_kind_section.py
JianxingHuang/ecint
4c41d9d7c77ee85dd3af69aa0999d093b6a8c7a3
[ "MIT" ]
1
2021-04-10T08:43:02.000Z
2021-04-10T08:43:02.000Z
from aiida.orm import StructureData from ase.io import read from ecint.preprocessor.kind import SetsFromYaml structure_path = './data/h2o.xyz' atoms = read(structure_path) structure = StructureData(ase=atoms) sets = SetsFromYaml(structure, None) kind_section = sets.kind_section print(kind_section)
23.230769
48
0.807947
from aiida.orm import StructureData from ase.io import read from ecint.preprocessor.kind import SetsFromYaml structure_path = './data/h2o.xyz' atoms = read(structure_path) structure = StructureData(ase=atoms) sets = SetsFromYaml(structure, None) kind_section = sets.kind_section print(kind_section)
true
true
1c3895135dfb43dda73ddd7725e49c81497da474
13,247
py
Python
test/unit/models/test_proposals.py
RottenCoin/sentinel
baae290dae92f393db3f884180bf1f2a47a605ce
[ "MIT" ]
null
null
null
test/unit/models/test_proposals.py
RottenCoin/sentinel
baae290dae92f393db3f884180bf1f2a47a605ce
[ "MIT" ]
null
null
null
test/unit/models/test_proposals.py
RottenCoin/sentinel
baae290dae92f393db3f884180bf1f2a47a605ce
[ "MIT" ]
null
null
null
import pytest import sys import os import time os.environ['SENTINEL_ENV'] = 'test' os.environ['SENTINEL_CONFIG'] = os.path.normpath(os.path.join(os.path.dirname(__file__), '../../test_sentinel.conf')) sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../../../lib'))) import misc import config fr...
52.988
3,633
0.780479
import pytest import sys import os import time os.environ['SENTINEL_ENV'] = 'test' os.environ['SENTINEL_CONFIG'] = os.path.normpath(os.path.join(os.path.dirname(__file__), '../../test_sentinel.conf')) sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../../../lib'))) import misc import config fr...
true
true
1c389685ff52c912f2612efea656ffd0b097758d
7,565
py
Python
model/deeplab.py
Shang-XH/BAFTT
62392325342f48b8a89f0c2bf71e48026dd90629
[ "MIT" ]
4
2021-09-07T03:29:38.000Z
2021-09-07T04:24:31.000Z
model/deeplab.py
Shang-XH/BAFTT
62392325342f48b8a89f0c2bf71e48026dd90629
[ "MIT" ]
null
null
null
model/deeplab.py
Shang-XH/BAFTT
62392325342f48b8a89f0c2bf71e48026dd90629
[ "MIT" ]
null
null
null
import torch.nn as nn import math import torch.utils.model_zoo as model_zoo import torch import numpy as np affine_par = True def outS(i): i = int(i) i = (i+1)/2 i = int(np.ceil((i+1)/2.0)) i = (i+1)/2 return i def conv3x3(in_planes, out_planes, stride=1): "3x3 convolution with padding" r...
33.325991
139
0.590482
import torch.nn as nn import math import torch.utils.model_zoo as model_zoo import torch import numpy as np affine_par = True def outS(i): i = int(i) i = (i+1)/2 i = int(np.ceil((i+1)/2.0)) i = (i+1)/2 return i def conv3x3(in_planes, out_planes, stride=1): return nn.Conv2d(in_planes, out_plan...
true
true
1c38968752d7f0fcd0cd4b1a3ffa0328cb1afaf8
1,374
py
Python
poolink_backend/bases/models.py
jaethewiederholen/Poolink_backend
3a1b28856bc8916aedb7735de8b64fef3269ef1b
[ "MIT" ]
null
null
null
poolink_backend/bases/models.py
jaethewiederholen/Poolink_backend
3a1b28856bc8916aedb7735de8b64fef3269ef1b
[ "MIT" ]
null
null
null
poolink_backend/bases/models.py
jaethewiederholen/Poolink_backend
3a1b28856bc8916aedb7735de8b64fef3269ef1b
[ "MIT" ]
null
null
null
import timeago from annoying.fields import AutoOneToOneField as _AutoOneToOneField from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from model_utils.models import TimeStampedModel class AutoOneToOneField(_AutoOneToOneField): pass class Manage...
26.941176
82
0.69869
import timeago from annoying.fields import AutoOneToOneField as _AutoOneToOneField from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from model_utils.models import TimeStampedModel class AutoOneToOneField(_AutoOneToOneField): pass class Manage...
true
true