max_stars_repo_path
stringlengths
4
286
max_stars_repo_name
stringlengths
5
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.03M
content_cleaned
stringlengths
6
1.03M
language
stringclasses
111 values
language_score
float64
0.03
1
comments
stringlengths
0
556k
edu_score
float64
0.32
5.03
edu_int_score
int64
0
5
src/python/errors.py
Miravalier/canonfire
1
8500
<reponame>Miravalier/canonfire<gh_stars>1-10 class AuthError(Exception): pass class JsonError(Exception): pass
class AuthError(Exception): pass class JsonError(Exception): pass
none
1
1.328375
1
vehicle/tests.py
COS301-SE-2020/ctrlintelligencecapstone
0
8501
<gh_stars>0 from rest_framework.test import APITestCase from rest_framework.test import APIRequestFactory import requests import pytest import json from django.core.management import call_command from django.db.models.signals import pre_save, post_save, pre_delete, post_delete, m2m_changed from rest_framework.test imp...
from rest_framework.test import APITestCase from rest_framework.test import APIRequestFactory import requests import pytest import json from django.core.management import call_command from django.db.models.signals import pre_save, post_save, pre_delete, post_delete, m2m_changed from rest_framework.test import APIClien...
en
0.566833
# Create your tests here. # @pytest.fixture(autouse=True) # def django_db_setup(django_db_setup, django_db_blocker): # signals = [pre_save, post_save, pre_delete, post_delete, m2m_changed] # restore = {} # with django_db_blocker.unblock(): # call_command("loaddata", "test_stuff.json") # response = c...
2.100935
2
simple_exercises/lanesexercises/py_functions2/rep_ex3.py
ilante/programming_immanuela_englander
0
8502
<filename>simple_exercises/lanesexercises/py_functions2/rep_ex3.py # 3. Define a function to check whether a number is even def even(num): if num%2 == 0: return True else: return False print(even(4)) print(even(-5))
<filename>simple_exercises/lanesexercises/py_functions2/rep_ex3.py # 3. Define a function to check whether a number is even def even(num): if num%2 == 0: return True else: return False print(even(4)) print(even(-5))
en
0.668047
# 3. Define a function to check whether a number is even
4.088111
4
book_figures/chapter5/fig_posterior_cauchy.py
aragilar/astroML
3
8503
<gh_stars>1-10 """ Posterior for Cauchy Distribution --------------------------------- Figure 5.11 The solid lines show the posterior pdf :math:`p(\mu|{x_i},I)` (top-left panel) and the posterior pdf :math:`p(\gamma|{x_i},I)` (top-right panel) for the two-dimensional pdf from figure 5.10. The dashed lines show the dis...
""" Posterior for Cauchy Distribution --------------------------------- Figure 5.11 The solid lines show the posterior pdf :math:`p(\mu|{x_i},I)` (top-left panel) and the posterior pdf :math:`p(\gamma|{x_i},I)` (top-right panel) for the two-dimensional pdf from figure 5.10. The dashed lines show the distribution of ap...
en
0.609688
Posterior for Cauchy Distribution --------------------------------- Figure 5.11 The solid lines show the posterior pdf :math:`p(\mu|{x_i},I)` (top-left panel) and the posterior pdf :math:`p(\gamma|{x_i},I)` (top-right panel) for the two-dimensional pdf from figure 5.10. The dashed lines show the distribution of approx...
2.679149
3
plaso/formatters/file_system.py
SamuelePilleri/plaso
0
8504
<filename>plaso/formatters/file_system.py # -*- coding: utf-8 -*- """The file system stat event formatter.""" from __future__ import unicode_literals from dfvfs.lib import definitions as dfvfs_definitions from plaso.formatters import interface from plaso.formatters import manager from plaso.lib import errors class...
<filename>plaso/formatters/file_system.py # -*- coding: utf-8 -*- """The file system stat event formatter.""" from __future__ import unicode_literals from dfvfs.lib import definitions as dfvfs_definitions from plaso.formatters import interface from plaso.formatters import manager from plaso.lib import errors class...
en
0.757601
# -*- coding: utf-8 -*- The file system stat event formatter. The file system stat event formatter. # The numeric values are for backwards compatibility with plaso files # generated with older versions of dfvfs. # pylint: disable=unused-argument Determines the formatted message strings for an event object. Args: ...
2.04127
2
applications/serializers.py
junlegend/back-landing-career
0
8505
from rest_framework import serializers from applications.models import Application class ApplicationSerializer(serializers.Serializer): content = serializers.JSONField() portfolio = serializers.FileField() class ApplicationAdminSerializer(serializers.ModelSerializer): class Meta: model = Appli...
from rest_framework import serializers from applications.models import Application class ApplicationSerializer(serializers.Serializer): content = serializers.JSONField() portfolio = serializers.FileField() class ApplicationAdminSerializer(serializers.ModelSerializer): class Meta: model = Appli...
none
1
1.999023
2
qualtrics_iat/qualtrics_tools.py
ycui1/QualtricsIAT
0
8506
from pathlib import Path import requests from requests_toolbelt.multipart.encoder import MultipartEncoder # api_token = "<KEY>" # brand_center = "mdanderson.co1" # data_center = "iad1" # headers = {"x-api-token": api_token} class QualtricsTool: """Data model to manage Qualtrics-related tools Parameters: ...
from pathlib import Path import requests from requests_toolbelt.multipart.encoder import MultipartEncoder # api_token = "<KEY>" # brand_center = "mdanderson.co1" # data_center = "iad1" # headers = {"x-api-token": api_token} class QualtricsTool: """Data model to manage Qualtrics-related tools Parameters: ...
en
0.66529
# api_token = "<KEY>" # brand_center = "mdanderson.co1" # data_center = "iad1" # headers = {"x-api-token": api_token} Data model to manage Qualtrics-related tools Parameters: ----------- api_token: str, the API token for the user data_center: str, the data center for the user brand_center: str, the ...
2.925196
3
linter.py
dndrsn/SublimeLinter-contrib-cspell
0
8507
<reponame>dndrsn/SublimeLinter-contrib-cspell from SublimeLinter.lint import Linter, STREAM_STDOUT class CSpell(Linter): cmd = 'cspell stdin' defaults = {'selector': 'source'} regex = r'^[^:]*:(?P<line>\d+):(?P<col>\d+) - (?P<message>.*)$' error_stream = STREAM_STDOUT
from SublimeLinter.lint import Linter, STREAM_STDOUT class CSpell(Linter): cmd = 'cspell stdin' defaults = {'selector': 'source'} regex = r'^[^:]*:(?P<line>\d+):(?P<col>\d+) - (?P<message>.*)$' error_stream = STREAM_STDOUT
none
1
2.329074
2
metal/gdb/__init__.py
cHemingway/test
24
8508
<reponame>cHemingway/test<filename>metal/gdb/__init__.py from metal.gdb.metal_break import Breakpoint, MetalBreakpoint from metal.gdb.exitcode import ExitBreakpoint from metal.gdb.timeout import Timeout from metal.gdb.newlib import NewlibBreakpoints from metal.gdb.argv import ArgvBreakpoint
from metal.gdb.metal_break import Breakpoint, MetalBreakpoint from metal.gdb.exitcode import ExitBreakpoint from metal.gdb.timeout import Timeout from metal.gdb.newlib import NewlibBreakpoints from metal.gdb.argv import ArgvBreakpoint
none
1
1.145697
1
portfolio/gui/tabresults/righttable.py
timeerr/portfolio
0
8509
<filename>portfolio/gui/tabresults/righttable.py #!/usr/bin/python3 from datetime import datetime from PyQt5.QtWidgets import QTableWidgetItem, QTableWidget, QAbstractItemView, QMenu, QMessageBox from PyQt5.QtGui import QCursor from PyQt5.QtCore import Qt, pyqtSignal, QObject from portfolio.db.fdbhandler import resu...
<filename>portfolio/gui/tabresults/righttable.py #!/usr/bin/python3 from datetime import datetime from PyQt5.QtWidgets import QTableWidgetItem, QTableWidget, QAbstractItemView, QMenu, QMessageBox from PyQt5.QtGui import QCursor from PyQt5.QtCore import Qt, pyqtSignal, QObject from portfolio.db.fdbhandler import resu...
en
0.812611
#!/usr/bin/python3 Decorator to flag self.updatingdata_flag whenever a function that edits data without user intervention is being run Table dynamically showing results # Custom Menu # A signal that will be emited whenever a line is removed # UI Tweaks # When edited, change the data on the database too # A flag to ...
2.283611
2
Day5/overlap_result.py
d4yvie/advent_of_code_2021
0
8510
<filename>Day5/overlap_result.py<gh_stars>0 class OverlapResult: def __init__(self, overlap_map: dict[tuple[float, float], int]): self._overlap_map = overlap_map self._overlaps = overlap_map_to_overlaps(overlap_map) @property def overlaps(self) -> int: return self._overlaps @p...
<filename>Day5/overlap_result.py<gh_stars>0 class OverlapResult: def __init__(self, overlap_map: dict[tuple[float, float], int]): self._overlap_map = overlap_map self._overlaps = overlap_map_to_overlaps(overlap_map) @property def overlaps(self) -> int: return self._overlaps @p...
none
1
2.863151
3
setup.py
NikolaiT/proxychecker
1
8511
<filename>setup.py #!/usr/bin/env python from distutils.core import setup VERSION = "0.0.1" setup( author='<NAME>', name = "proxychecker", version = VERSION, description = "A Python proxychecker module that makes use of socks", url = "http://incolumitas.com", license = "BSD", author_email ...
<filename>setup.py #!/usr/bin/env python from distutils.core import setup VERSION = "0.0.1" setup( author='<NAME>', name = "proxychecker", version = VERSION, description = "A Python proxychecker module that makes use of socks", url = "http://incolumitas.com", license = "BSD", author_email ...
ru
0.26433
#!/usr/bin/env python
1.237086
1
charlotte/charlotte.py
puiterwijk/charlotte
5
8512
<filename>charlotte/charlotte.py class Config: def __init__(self, config_file_name): self.config_file_name = config_file_name
<filename>charlotte/charlotte.py class Config: def __init__(self, config_file_name): self.config_file_name = config_file_name
none
1
1.768943
2
python/app/plugins/http/Struts2/S2_052.py
taomujian/linbing
351
8513
#!/usr/bin/env python3 from app.lib.utils.request import request from app.lib.utils.encode import base64encode from app.lib.utils.common import get_capta, get_useragent class S2_052_BaseVerify: def __init__(self, url): self.info = { 'name': 'S2-052漏洞,又名CVE-2017-9805漏洞', 'descriptio...
#!/usr/bin/env python3 from app.lib.utils.request import request from app.lib.utils.encode import base64encode from app.lib.utils.common import get_capta, get_useragent class S2_052_BaseVerify: def __init__(self, url): self.info = { 'name': 'S2-052漏洞,又名CVE-2017-9805漏洞', 'descriptio...
en
0.190416
#!/usr/bin/env python3 <map> <entry> <jdk.nashorn.internal.objects.NativeString> <flags>0</flags> <value class="com.sun.xml.internal.bind.v2.runtime.unmarshaller.Base64Data"> <data...
2.387362
2
UPD/extension/utils.py
RIDCorix/UPD
0
8514
<reponame>RIDCorix/UPD<gh_stars>0 import sys # def get_tools(): # manager = PluginManager() # manager.setPluginPlaces(["plugins/file_cabinet"]) # manager.collectPlugins() # return [plugin.plugin_object for plugin in manager.getAllPlugins()] def get_tools(): import importlib tools = ['file_cabi...
import sys # def get_tools(): # manager = PluginManager() # manager.setPluginPlaces(["plugins/file_cabinet"]) # manager.collectPlugins() # return [plugin.plugin_object for plugin in manager.getAllPlugins()] def get_tools(): import importlib tools = ['file_cabinet', 'us', 'automator', 'main'] ...
en
0.339047
# def get_tools(): # manager = PluginManager() # manager.setPluginPlaces(["plugins/file_cabinet"]) # manager.collectPlugins() # return [plugin.plugin_object for plugin in manager.getAllPlugins()]
2.255539
2
sbin/preload_findit_coverage_2.py
cariaso/metapub
28
8515
<filename>sbin/preload_findit_coverage_2.py from __future__ import absolute_import, print_function, unicode_literals # "preload" for FindIt #2: iterate over same journal list, but actually # load a PubMedArticle object on each PMID. (no list output created) from metapub import FindIt, PubMedFetcher from metapub.fin...
<filename>sbin/preload_findit_coverage_2.py from __future__ import absolute_import, print_function, unicode_literals # "preload" for FindIt #2: iterate over same journal list, but actually # load a PubMedArticle object on each PMID. (no list output created) from metapub import FindIt, PubMedFetcher from metapub.fin...
en
0.614009
# "preload" for FindIt #2: iterate over same journal list, but actually # load a PubMedArticle object on each PMID. (no list output created)
2.566462
3
sgcache/control.py
vfxetc/sgcache
13
8516
<gh_stars>10-100 from __future__ import absolute_import from select import select import errno import functools import itertools import json import logging import os import socket import threading import time import traceback log = logging.getLogger(__name__) from .utils import makedirs, unlink class TimeOut(Exce...
from __future__ import absolute_import from select import select import errno import functools import itertools import json import logging import os import socket import threading import time import traceback log = logging.getLogger(__name__) from .utils import makedirs, unlink class TimeOut(Exception): pass ...
en
0.941029
# This is indempodent. # Track what has been sent automatically. # Attempt to reconnect a couple times when sending this. # If the handler replied, then we are done. # TODO: Try connecting to it before destroying it.
2.278804
2
lantz/drivers/tektronix/tds1002b.py
mtsolmn/lantz-drivers
4
8517
<reponame>mtsolmn/lantz-drivers # -*- coding: utf-8 -*- """ lantz.drivers.tektronix.tds1012 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Implements the drivers to control an oscilloscope. :copyright: 2015 by Lantz Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from lan...
# -*- coding: utf-8 -*- """ lantz.drivers.tektronix.tds1012 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Implements the drivers to control an oscilloscope. :copyright: 2015 by Lantz Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from lantz.core import Feat, MessageBase...
en
0.660387
# -*- coding: utf-8 -*- lantz.drivers.tektronix.tds1012 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Implements the drivers to control an oscilloscope. :copyright: 2015 by Lantz Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details.
1.875044
2
specs/dxgi.py
linkmauve/apitrace
1
8518
########################################################################## # # Copyright 2014 VMware, Inc # Copyright 2011 <NAME> # All Rights Reserved. # # 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 t...
########################################################################## # # Copyright 2014 VMware, Inc # Copyright 2011 <NAME> # All Rights Reserved. # # 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 t...
en
0.617361
########################################################################## # # Copyright 2014 VMware, Inc # Copyright 2011 <NAME> # All Rights Reserved. # # 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 t...
1.265041
1
code/camera_calib.py
nitchith/CarND-Advanced-Lane-Lines
0
8519
<filename>code/camera_calib.py<gh_stars>0 import numpy as np import cv2 import glob import matplotlib.pyplot as plt def camera_calibrate(images_list, nx=9, ny=6, show_corners=False): # prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) objp = np.zeros((ny*nx,3), np.float32) objp[:,:2] = np....
<filename>code/camera_calib.py<gh_stars>0 import numpy as np import cv2 import glob import matplotlib.pyplot as plt def camera_calibrate(images_list, nx=9, ny=6, show_corners=False): # prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) objp = np.zeros((ny*nx,3), np.float32) objp[:,:2] = np....
en
0.776663
# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) # Arrays to store object points and image points from all the images. # 3d points in real world space # 2d points in image plane. # Make a list of calibration images # Step through the list and search for chessboard corners # Find the chessboard corne...
2.994801
3
python-jenkins/yaml_read_config/custom_log.py
MathiasStadler/docker-jenkins-scripted
0
8520
""" module logging""" # logging
""" module logging""" # logging
en
0.272248
module logging # logging
1.098673
1
src/stratis_cli/_actions/_pool.py
stratis-storage/stratis-cli
94
8521
<gh_stars>10-100 # Copyright 2021 Red Hat, 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 agr...
# Copyright 2021 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
en
0.646974
# Copyright 2021 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
1.521061
2
synchrobot/chat_user.py
Esenin/telegram_vk_pipe_bot
2
8522
<reponame>Esenin/telegram_vk_pipe_bot<filename>synchrobot/chat_user.py # -*- coding: utf-8 -*- # Author: <NAME> import calendar import time import datetime as dt import json class User(object): def __init__(self, id, name, last_seen, want_time, muted, username="", additional_keys="{}"): super(User, self).__init__(...
# -*- coding: utf-8 -*- # Author: <NAME> import calendar import time import datetime as dt import json class User(object): def __init__(self, id, name, last_seen, want_time, muted, username="", additional_keys="{}"): super(User, self).__init__() self.id = id self.name = name self.username = username self._...
en
0.80418
# -*- coding: utf-8 -*- # Author: <NAME>
2.751409
3
backend/src/contaxy/schema/auth.py
Felipe-Renck/contaxy
0
8523
<gh_stars>0 from datetime import datetime, timezone from enum import Enum from typing import Dict, List, Optional import pydantic from fastapi import HTTPException, Path, status from pydantic import BaseModel, EmailStr, Field from contaxy.schema.exceptions import ClientValueError from contaxy.schema.shared import MAX...
from datetime import datetime, timezone from enum import Enum from typing import Dict, List, Optional import pydantic from fastapi import HTTPException, Path, status from pydantic import BaseModel, EmailStr, Field from contaxy.schema.exceptions import ClientValueError from contaxy.schema.shared import MAX_DESCRIPTION...
en
0.700912
# Map to: select, insert, update, delete # Viewer, view: Allows admin access , Can only view existing resources. Permissions for read-only actions that do not affect state, such as viewing (but not modifying) existing resources or data. # Editor, edit, Contributor : Allows read/write access , Can create and manage all ...
2.086255
2
setup.py
richarddwang/hugdatafast
19
8524
import setuptools from hugdatafast.__init__ import __version__ with open("README.md", "r") as fh: long_description = fh.read() REQUIRED_PKGS = [ 'fastai>=2.0.8', 'fastscore>=1.0.1', # change of store_attr api 'datasets', ] setuptools.setup( name="hugdatafast", version=__version__, author=...
import setuptools from hugdatafast.__init__ import __version__ with open("README.md", "r") as fh: long_description = fh.read() REQUIRED_PKGS = [ 'fastai>=2.0.8', 'fastscore>=1.0.1', # change of store_attr api 'datasets', ] setuptools.setup( name="hugdatafast", version=__version__, author=...
en
0.229856
# change of store_attr api
1.294056
1
tests/scripts/test_repository_actor_definition.py
drehak/leapp
0
8525
import pytest from leapp.repository.actor_definition import ActorDefinition, ActorInspectionFailedError, MultipleActorsError from leapp.exceptions import UnsupportedDefinitionKindError from leapp.repository import DefinitionKind from helpers import repository_dir import logging import mock _FAKE_META_DATA = { 'de...
import pytest from leapp.repository.actor_definition import ActorDefinition, ActorInspectionFailedError, MultipleActorsError from leapp.exceptions import UnsupportedDefinitionKindError from leapp.repository import DefinitionKind from helpers import repository_dir import logging import mock _FAKE_META_DATA = { 'de...
en
0.882709
# Assert to ensure we covered all keys
2.136643
2
iHome/house/models.py
yeyuning1/iHome
2
8526
<gh_stars>1-10 from django.db import models # Create your models here. from utils.models import BaseModel class House(BaseModel): '''房屋信息''' user = models.ForeignKey('users.User', on_delete=models.CASCADE, verbose_name='房屋用户') area = models.ForeignKey('address.Area', on_delete=models.SET_NULL, n...
from django.db import models # Create your models here. from utils.models import BaseModel class House(BaseModel): '''房屋信息''' user = models.ForeignKey('users.User', on_delete=models.CASCADE, verbose_name='房屋用户') area = models.ForeignKey('address.Area', on_delete=models.SET_NULL, null=True, verbo...
zh
0.97096
# Create your models here. 房屋信息 # 单价分 # 如几室几厅 # 房屋容纳的人数 # 0表示不限制 #配套设施 房屋设施信息 房屋图片
2.238565
2
cltwit/main.py
Psycojoker/cltwit
0
8527
<filename>cltwit/main.py #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Cltwit is a command line twitter utility Author : <NAME> Date : 2013 """ import os import sys import re import getopt import gettext import sqlite3 import webbrowser import ConfigParser from sqlite2csv import sqlite2csv from cltwitdb import c...
<filename>cltwit/main.py #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Cltwit is a command line twitter utility Author : <NAME> Date : 2013 """ import os import sys import re import getopt import gettext import sqlite3 import webbrowser import ConfigParser from sqlite2csv import sqlite2csv from cltwitdb import c...
fr
0.977159
#!/usr/bin/env python2 # -*- coding: utf-8 -*- Cltwit is a command line twitter utility Author : <NAME> Date : 2013 # Répertoire pour conf et bdd # Fichier de configuration # base de données et table sqlite # gestion des couleurs sur le terminal Vérifier la prise en charge des couleurs par le terminal # couleurs auto s...
2.597198
3
weibo_image_spider/exceptions.py
lonsty/weibo-pic-spider-hd
0
8528
# @AUTHOR : lonsty # @DATE : 2020/3/28 18:01 class CookiesExpiredException(Exception): pass class NoImagesException(Exception): pass class ContentParserError(Exception): pass class UserNotFound(Exception): pass
# @AUTHOR : lonsty # @DATE : 2020/3/28 18:01 class CookiesExpiredException(Exception): pass class NoImagesException(Exception): pass class ContentParserError(Exception): pass class UserNotFound(Exception): pass
en
0.341225
# @AUTHOR : lonsty # @DATE : 2020/3/28 18:01
1.490781
1
WebHtmlExample/WebHtmlExample.py
lilei644/python-learning-example
2
8529
<reponame>lilei644/python-learning-example import requests from bs4 import BeautifulSoup import re # 设置请求头 # 更换一下爬虫的User-Agent,这是最常规的爬虫设置 headers = { "User-Agent": 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'} # 获取天气信息 def get_weather...
import requests from bs4 import BeautifulSoup import re # 设置请求头 # 更换一下爬虫的User-Agent,这是最常规的爬虫设置 headers = { "User-Agent": 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'} # 获取天气信息 def get_weather(): html = requests.get("http://www.wea...
zh
0.418808
# 设置请求头 # 更换一下爬虫的User-Agent,这是最常规的爬虫设置 # 获取天气信息 # 获取贴吧回复数 # <span class="threadlist_rep_num center_text" title="回复">9</span>
3.231842
3
Codi/diode.py
JosepFanals/HELM
1
8530
import numpy as np import math import matplotlib.pyplot as plt U = 5 # equival a l'E R = 2 # equival a R1 R2 = 3 P = 1.2 Vt = 0.026 Is = 0.000005 n = 200 # profunditat Vd = np.zeros(n) # sèries Vl = np.zeros(n) I1 = np.zeros(n) I1[0] = U / R # inicialització de les sèries Vd[0] = Vt * math.log(1 + I1[0] / Is)...
import numpy as np import math import matplotlib.pyplot as plt U = 5 # equival a l'E R = 2 # equival a R1 R2 = 3 P = 1.2 Vt = 0.026 Is = 0.000005 n = 200 # profunditat Vd = np.zeros(n) # sèries Vl = np.zeros(n) I1 = np.zeros(n) I1[0] = U / R # inicialització de les sèries Vd[0] = Vt * math.log(1 + I1[0] / Is)...
ca
0.997665
# equival a l'E # equival a R1 # profunditat # sèries # inicialització de les sèries # convolució pel càlcul de Vd[i] # convolució pel càlcul de Vl[i] # càlcul dels coeficients # per tal de veure com evoluciona la tensió del díode
2.925153
3
proxybroker/errors.py
aljeshishe/ProxyBroker
0
8531
<filename>proxybroker/errors.py """Errors.""" class ProxyError(Exception): pass class NoProxyError(Exception): pass class ResolveError(Exception): pass class ProxyConnError(ProxyError): pass class ProxyRecvError(ProxyError): # connection_is_reset pass class ProxySendError(ProxyError): ...
<filename>proxybroker/errors.py """Errors.""" class ProxyError(Exception): pass class NoProxyError(Exception): pass class ResolveError(Exception): pass class ProxyConnError(ProxyError): pass class ProxyRecvError(ProxyError): # connection_is_reset pass class ProxySendError(ProxyError): ...
en
0.415832
Errors. # connection_is_reset # connection_is_reset # BadStatusLine
2.126809
2
questionanswering/models/pooling.py
lvying1991/KBQA-System
2
8532
<filename>questionanswering/models/pooling.py import torch from torch import nn as nn from torch import autograd class LogSumExpPooling1d(nn.Module): """Applies a 1D LogSumExp pooling over an input signal composed of several input planes. LogSumExp is a smooth approximation of the max function. 在由多个输入平面组成...
<filename>questionanswering/models/pooling.py import torch from torch import nn as nn from torch import autograd class LogSumExpPooling1d(nn.Module): """Applies a 1D LogSumExp pooling over an input signal composed of several input planes. LogSumExp is a smooth approximation of the max function. 在由多个输入平面组成...
en
0.44666
Applies a 1D LogSumExp pooling over an input signal composed of several input planes. LogSumExp is a smooth approximation of the max function. 在由多个输入平面组成的输入信号上应用1D LogSumExp池。 LogSumExp是max函数的平滑近似值。 Examples: >>> m = LogSumExpPooling1d() >>> input = autograd.Variable(torch.randn(4, 5, 10)) ...
3.162076
3
tests/unit/app/test_session.py
bernease/whylogs-python
0
8533
<reponame>bernease/whylogs-python import pytest from whylogs.app.session import get_or_create_session, get_session, get_logger, reset_default_session, session_from_config from whylogs.app.config import SessionConfig from whylogs.app.session import Session from pandas import util def test_get_global_session(): _...
import pytest from whylogs.app.session import get_or_create_session, get_session, get_logger, reset_default_session, session_from_config from whylogs.app.config import SessionConfig from whylogs.app.session import Session from pandas import util def test_get_global_session(): _session = None session = get_or_...
none
1
2.401841
2
Packages/constants.py
Bemesko/Intelligence-of-Home-GUI
0
8534
<reponame>Bemesko/Intelligence-of-Home-GUI<filename>Packages/constants.py import enum BASELINE = "baseline" ENERGY = "energy" MAX_PRICE = "max_price" START_PRICE = "starting_price" INCREMENT = "increment" MIN_PRICE = "min_price" MAX_LOT_SIZE = "max_lot_size_wh" NAMESERVER_AGENT_AMOUNT = 3 ATTRIBUTE_LIST_LENGTH = 50 N...
import enum BASELINE = "baseline" ENERGY = "energy" MAX_PRICE = "max_price" START_PRICE = "starting_price" INCREMENT = "increment" MIN_PRICE = "min_price" MAX_LOT_SIZE = "max_lot_size_wh" NAMESERVER_AGENT_AMOUNT = 3 ATTRIBUTE_LIST_LENGTH = 50 NEXT_ENERGY_CONSUMPTION = "next_energy_consumption" NEXT_ENERGY_GENERATION ...
none
1
2.580655
3
target/tests.py
groundupnews/gu
19
8535
<reponame>groundupnews/gu from django.contrib.auth.models import User from django.test import TestCase from django.test import Client from django.urls import reverse from target import models from django.utils import timezone # Create your tests here. class URLSWork(TestCase): @classmethod def setUpTestData(...
from django.contrib.auth.models import User from django.test import TestCase from django.test import Client from django.urls import reverse from target import models from django.utils import timezone # Create your tests here. class URLSWork(TestCase): @classmethod def setUpTestData(cls): target = mod...
en
0.95562
# Create your tests here.
2.474484
2
jenkinsapi/view.py
julienduchesne/jenkinsapi
0
8536
<reponame>julienduchesne/jenkinsapi """ Module for jenkinsapi views """ import six import logging from jenkinsapi.jenkinsbase import JenkinsBase from jenkinsapi.job import Job from jenkinsapi.custom_exceptions import NotFound log = logging.getLogger(__name__) class View(JenkinsBase): """ View class ""...
""" Module for jenkinsapi views """ import six import logging from jenkinsapi.jenkinsbase import JenkinsBase from jenkinsapi.job import Job from jenkinsapi.custom_exceptions import NotFound log = logging.getLogger(__name__) class View(JenkinsBase): """ View class """ def __init__(self, url, name,...
en
0.881594
Module for jenkinsapi views View class True if view_name is the name of a defined view Remove this view object # noinspection PyUnboundLocalVariable Add job to a view :param str_job_name: name of the job to be added :param job: Job object to be added :return: True if job has been added, False i...
2.421739
2
core/vision/collection.py
jmarangola/cv-chess
0
8537
""" Autonomous dataset collection of data for jetson nano <NAME> - <EMAIL> """ import datasets import json from datasets import Board, ChessPiece, PieceColor, PieceType #from realsense_utils import RealSenseCamera import preprocessing as pr import cv2 import pandas as pd import os from os.path import isfile, join im...
""" Autonomous dataset collection of data for jetson nano <NAME> - <EMAIL> """ import datasets import json from datasets import Board, ChessPiece, PieceColor, PieceType #from realsense_utils import RealSenseCamera import preprocessing as pr import cv2 import pandas as pd import os from os.path import isfile, join im...
en
0.496621
Autonomous dataset collection of data for jetson nano <NAME> - <EMAIL> #from realsense_utils import RealSenseCamera # Run calibration sequence or use preexisting board four corners data from config/setup.txt # Where the debug metadata board visualization image is saved (to ensure we properly setup the metadata) # Wher...
2.465792
2
tests/test_sbfc.py
htwangtw/sbfc
0
8538
<reponame>htwangtw/sbfc import os import numpy as np import pandas as pd from nilearn import datasets from sbfc.parser import seed_base_connectivity seed = os.path.dirname(__file__) + "/data/difumo64_pcc.nii.gz" def _make_data_single_run(confound=True): adhd_dataset = datasets.fetch_adhd(n_subjects=2) grou...
import os import numpy as np import pandas as pd from nilearn import datasets from sbfc.parser import seed_base_connectivity seed = os.path.dirname(__file__) + "/data/difumo64_pcc.nii.gz" def _make_data_single_run(confound=True): adhd_dataset = datasets.fetch_adhd(n_subjects=2) group_confounds = pd.DataFra...
en
0.458905
# Prepare seed # mask seed # mask seed
2.324539
2
final_project/machinetranslation/tests/test.py
ChrisOmeh/xzceb-flask_eng_fr
0
8539
<gh_stars>0 import unittest from translator import english_to_french, french_to_english class TestenglishToFrench(unittest.TestCase): def test1(self): self.assertEqual(english_to_french(["Hello"]), "Bonjour") self.assertNotEqual(english_to_french(["Bonjour"]), "Hello") class TestfrenchToEnglish(un...
import unittest from translator import english_to_french, french_to_english class TestenglishToFrench(unittest.TestCase): def test1(self): self.assertEqual(english_to_french(["Hello"]), "Bonjour") self.assertNotEqual(english_to_french(["Bonjour"]), "Hello") class TestfrenchToEnglish(unittest.TestC...
none
1
3.384967
3
tests/ut/python/parallel/test_auto_parallel_transformer.py
huxian123/mindspore
2
8540
<reponame>huxian123/mindspore # Copyright 2019 Huawei Technologies Co., Ltd # # 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 ...
# Copyright 2019 Huawei Technologies Co., Ltd # # 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...
en
0.847984
# Copyright 2019 Huawei Technologies Co., Ltd # # 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...
1.957826
2
cloudcafe/compute/events/models/common.py
rcbops-qa/cloudcafe
0
8541
<reponame>rcbops-qa/cloudcafe """ Copyright 2015 Rackspace 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 agree...
""" Copyright 2015 Rackspace Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dist...
en
0.728559
Copyright 2015 Rackspace Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distribu...
1.988386
2
openpyxl/drawing/tests/test_shapes.py
sekcheong/openpyxl
0
8542
from __future__ import absolute_import # Copyright (c) 2010-2017 openpyxl import pytest from openpyxl.xml.functions import fromstring, tostring from openpyxl.tests.helper import compare_xml @pytest.fixture def GradientFillProperties(): from ..fill import GradientFillProperties return GradientFillProperties ...
from __future__ import absolute_import # Copyright (c) 2010-2017 openpyxl import pytest from openpyxl.xml.functions import fromstring, tostring from openpyxl.tests.helper import compare_xml @pytest.fixture def GradientFillProperties(): from ..fill import GradientFillProperties return GradientFillProperties ...
en
0.189038
# Copyright (c) 2010-2017 openpyxl <gradFill></gradFill> <gradFill></gradFill> <xfrm></xfrm> <root />
2.387977
2
raysect/core/math/function/float/function3d/interpolate/tests/scripts/generate_3d_splines.py
raysect/source
71
8543
<filename>raysect/core/math/function/float/function3d/interpolate/tests/scripts/generate_3d_splines.py # Copyright (c) 2014-2021, Dr <NAME>, Raysect Project # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions...
<filename>raysect/core/math/function/float/function3d/interpolate/tests/scripts/generate_3d_splines.py # Copyright (c) 2014-2021, Dr <NAME>, Raysect Project # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions...
en
0.562232
# Copyright (c) 2014-2021, Dr <NAME>, Raysect Project # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # thi...
1.473447
1
supertokens_python/recipe_module.py
girish946/supertokens-python
36
8544
# Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved. # # This software is licensed under the Apache License, Version 2.0 (the # "License") as published by the Apache Software Foundation. # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at...
# Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved. # # This software is licensed under the Apache License, Version 2.0 (the # "License") as published by the Apache Software Foundation. # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at...
en
0.896635
# Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved. # # This software is licensed under the Apache License, Version 2.0 (the # "License") as published by the Apache Software Foundation. # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at...
1.94416
2
tests/__init__.py
mihaidumitrescu/flake8-html
36
8545
<filename>tests/__init__.py # -*- coding: utf-8 -*- """Tests go in this directory."""
<filename>tests/__init__.py # -*- coding: utf-8 -*- """Tests go in this directory."""
en
0.908211
# -*- coding: utf-8 -*- Tests go in this directory.
1.11441
1
datajoint-workflow/{{cookiecutter.github_repo}}/src/{{cookiecutter.__pkg_import_name}}/version.py
Yambottle/dj-workflow-template
0
8546
__version__ = "{{cookiecutter._pkg_version}}"
__version__ = "{{cookiecutter._pkg_version}}"
none
1
1.156341
1
examples/benchmarking/benchmark_bm25.py
shibing624/similarities
16
8547
<gh_stars>10-100 # -*- coding: utf-8 -*- """ @author:XuMing(<EMAIL>) @description: """ import datetime import os import pathlib import random import sys from loguru import logger sys.path.append('../..') from similarities import BM25Similarity from similarities.utils import http_get from similarities.data_loader impo...
# -*- coding: utf-8 -*- """ @author:XuMing(<EMAIL>) @description: """ import datetime import os import pathlib import random import sys from loguru import logger sys.path.append('../..') from similarities import BM25Similarity from similarities.utils import http_get from similarities.data_loader import SearchDataLoad...
en
0.62628
# -*- coding: utf-8 -*- @author:XuMing(<EMAIL>) @description: # Download scifact.zip dataset and unzip the dataset #### Loading test queries and corpus in DBPedia #### Randomly sample 1M pairs from Original Corpus (4.63M pairs) #### First include all relevant documents (i.e. present in qrels) #### Remove already seen k...
2.391567
2
tb/test_arp_64.py
sergachev/verilog-ethernet
2
8548
<reponame>sergachev/verilog-ethernet #!/usr/bin/env python """ Copyright (c) 2014-2018 <NAME> 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...
#!/usr/bin/env python """ Copyright (c) 2014-2018 <NAME> 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, ...
en
0.765828
#!/usr/bin/env python Copyright (c) 2014-2018 <NAME> 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, publi...
1.723785
2
NitroGenerator.py
ATRS7391/Discord_Nitro_Generator_And_Checker_Python_Version
2
8549
<reponame>ATRS7391/Discord_Nitro_Generator_And_Checker_Python_Version import random import sys import subprocess def pip_install(module: str): subprocess.run([sys.executable, "-m", "pip", "-q", "--disable-pip-version-check", "install", module]) try: import requests except: print("'requests' ...
import random import sys import subprocess def pip_install(module: str): subprocess.run([sys.executable, "-m", "pip", "-q", "--disable-pip-version-check", "install", module]) try: import requests except: print("'requests' module not found! Trying to install... ") pip_install("requests")...
en
0.545561
+-------------------------+ | Discord Nitro Generator | +-------------------------+ Note: For Educational Purposes Only © ATRS 2021. All Rights Reserved.
2.600834
3
2015/main/13/part2.py
sgravrock/adventofcode
0
8550
<filename>2015/main/13/part2.py import sys import itertools def readfile(f): result = {} for line in f: fields = line.rstrip().split(" ") p1 = fields[0] p2 = fields[10].replace(".", "") n = int(fields[3]) if fields[2] == "lose": n *= -1 result[(p1, p2)] = n return result def optimal(config): add_se...
<filename>2015/main/13/part2.py import sys import itertools def readfile(f): result = {} for line in f: fields = line.rstrip().split(" ") p1 = fields[0] p2 = fields[10].replace(".", "") n = int(fields[3]) if fields[2] == "lose": n *= -1 result[(p1, p2)] = n return result def optimal(config): add_se...
none
1
3.35208
3
networking/connection/stun_client.py
bcgrendel/python_networking
0
8551
<reponame>bcgrendel/python_networking import socket import sys import traceback import struct import threading; from threading import Thread; import time; import datetime; import json #import buffered_message; import hashlib from Crypto.PublicKey import RSA from connection_state import ConnectionState # publickey = RSA...
import socket import sys import traceback import struct import threading; from threading import Thread; import time; import datetime; import json #import buffered_message; import hashlib from Crypto.PublicKey import RSA from connection_state import ConnectionState # publickey = RSA.importKey(key_string) import tcp; im...
en
0.722216
#import buffered_message; # publickey = RSA.importKey(key_string) # ************* # EXAMPLE USAGE # ************* import socket import tcp import udp import stun_client import time start_listening = True local_ip = socket.gethostbyname(socket.gethostname()) local_port = 30779 server_ip = socket.gethostbyname(socket.ge...
2.682485
3
tools/wptserve/tests/functional/test_response.py
qanat/wpt
1
8552
import os import unittest import json import types from http.client import BadStatusLine from io import BytesIO import pytest wptserve = pytest.importorskip("wptserve") from .base import TestUsingServer, TestUsingH2Server, doc_root def send_body_as_header(self): if self._response.add_required_headers: s...
import os import unittest import json import types from http.client import BadStatusLine from io import BytesIO import pytest wptserve = pytest.importorskip("wptserve") from .base import TestUsingServer, TestUsingH2Server, doc_root def send_body_as_header(self): if self._response.add_required_headers: s...
en
0.956994
# Should detect stream isn't ended and call `writer.end_stream()`
2.425812
2
bbc1/core/command.py
ks91/bbc1-pub
89
8553
# -*- coding: utf-8 -*- """ Copyright (c) 2017 beyond-blockchain.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 applicable l...
# -*- coding: utf-8 -*- """ Copyright (c) 2017 beyond-blockchain.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 applicable l...
en
0.854731
# -*- coding: utf-8 -*- Copyright (c) 2017 beyond-blockchain.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 applicable law o...
2.595205
3
main.py
cmcquinn/cmake-uvision-syncer
0
8554
""" Usage: main.py [<project>] Options: <project> Path to the .uvprojx file (Keil® µVision5 Project File). The .uvoptx file (Keil® µVision5 Project Options file) will be located automatically as it shall be adjacent to the .uvprojx file, having the same filenam...
""" Usage: main.py [<project>] Options: <project> Path to the .uvprojx file (Keil® µVision5 Project File). The .uvoptx file (Keil® µVision5 Project Options file) will be located automatically as it shall be adjacent to the .uvprojx file, having the same filenam...
en
0.786815
Usage: main.py [<project>] Options: <project> Path to the .uvprojx file (Keil® µVision5 Project File). The .uvoptx file (Keil® µVision5 Project Options file) will be located automatically as it shall be adjacent to the .uvprojx file, having the same filename. ...
2.892172
3
scipy/weave/base_spec.py
lesserwhirls/scipy-cwt
8
8555
<filename>scipy/weave/base_spec.py class base_converter(object): """ Properties: headers -- list of strings that name the header files needed by this object. include_dirs -- list of directories where the header files can be found. libraries -- list of libraries...
<filename>scipy/weave/base_spec.py class base_converter(object): """ Properties: headers -- list of strings that name the header files needed by this object. include_dirs -- list of directories where the header files can be found. libraries -- list of libraries...
en
0.778711
Properties: headers -- list of strings that name the header files needed by this object. include_dirs -- list of directories where the header files can be found. libraries -- list of libraries needed to link to when compiling extension. libra...
2.922301
3
xception/test.py
latentai/model-zoo-models
8
8556
<filename>xception/test.py #!/usr/bin/env python3 from utils.model_config_helpers import run_model_test run_model_test()
<filename>xception/test.py #!/usr/bin/env python3 from utils.model_config_helpers import run_model_test run_model_test()
fr
0.221828
#!/usr/bin/env python3
1.35047
1
mpunet/bin/cv_split.py
alexsosn/MultiPlanarUNet
0
8557
<filename>mpunet/bin/cv_split.py from glob import glob import sys import os import numpy as np import random from mpunet.utils import create_folders import argparse def get_parser(): parser = argparse.ArgumentParser(description="Prepare a data folder for a" "CV exp...
<filename>mpunet/bin/cv_split.py from glob import glob import sys import os import numpy as np import random from mpunet.utils import create_folders import argparse def get_parser(): parser = argparse.ArgumentParser(description="Prepare a data folder for a" "CV exp...
en
0.833502
# Get file name # Get label path (OBS: filenames must match!) # Get relative paths # Symlink or copy On some system synlinks are not supported, if --files_list flag is set, uses this function to add each absolute file path to a list at the final subfolder that is supposed to store images and label links or actu...
2.946126
3
src/client/pydaos/raw/conversion.py
gczsjdy/daos
1
8558
#!/usr/bin/python """ (C) Copyright 2018 Intel Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
#!/usr/bin/python """ (C) Copyright 2018 Intel Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
en
0.828556
#!/usr/bin/python (C) Copyright 2018 Intel Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or...
2.770958
3
experiments/nmt/utils/vocabulary_coverage.py
lvapeab/GroundHog_INMT
0
8559
import cPickle import argparse parser = argparse.ArgumentParser( "Computes the coverage of a shortlist in a corpus file") parser.add_argument("--vocab", required=True, help="Vocabulary to use (.pkl)") parser.add_argument("--text", required=True, help="Beam size, turn...
import cPickle import argparse parser = argparse.ArgumentParser( "Computes the coverage of a shortlist in a corpus file") parser.add_argument("--vocab", required=True, help="Vocabulary to use (.pkl)") parser.add_argument("--text", required=True, help="Beam size, turn...
none
1
2.947798
3
stores/apps/inventory/migrations/0001_initial.py
diassor/CollectorCity-Market-Place
135
8560
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ProductType' db.create_table('inventory_producttype', ( ('id', self.gf('django...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ProductType' db.create_table('inventory_producttype', ( ('id', self.gf('django...
en
0.654754
# encoding: utf-8 # Adding model 'ProductType' # Adding model 'Product' # Adding model 'Coin' # Deleting model 'ProductType' # Deleting model 'Product' # Deleting model 'Coin'
2.163169
2
src/ralph/deployment/migrations/0005_auto__add_field_archiveddeployment_service__add_field_archiveddeployme.py
vi4m/ralph
1
8561
<reponame>vi4m/ralph # -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ArchivedDeployment.service' db.add_column('deployment_archiveddeploymen...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ArchivedDeployment.service' db.add_column('deployment_archiveddeployment', 'service', ...
en
0.751659
# -*- coding: utf-8 -*- # Adding field 'ArchivedDeployment.service' # Adding field 'ArchivedDeployment.device_environment' # Adding field 'Deployment.service' # Adding field 'Deployment.device_environment' # Deleting field 'ArchivedDeployment.service' # Deleting field 'ArchivedDeployment.device_environment' # Deleting ...
2.186032
2
SPH/sphbwr_example2.py
RLReed/unotran
0
8562
import numpy as np import sys sys.path.append('/homes/rlreed/workspace/unotran/src') from coarseBounds import computeBounds, Grouping import pickle from makeDLPbasis import makeBasis as makeDLP from makeKLTbasis import makeBasis as makeKLT import sph import sph_dgm import pydgm def buildGEO(ass_map): fine_map = [...
import numpy as np import sys sys.path.append('/homes/rlreed/workspace/unotran/src') from coarseBounds import computeBounds, Grouping import pickle from makeDLPbasis import makeBasis as makeDLP from makeKLTbasis import makeBasis as makeKLT import sph import sph_dgm import pydgm def buildGEO(ass_map): fine_map = [...
en
0.745112
# Get the homogenized cross sections
1.872758
2
src/oci/management_agent/models/management_agent_aggregation_dimensions.py
CentroidChef/oci-python-sdk
249
8563
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
en
0.737054
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
1.714254
2
py_buycoins/sending.py
Bashorun97/BuyCoins-Python-SDK
1
8564
from .gcore.queries import GetNetworkFee, GetBalance from .gcore.mutations import SendCoin from typing import List, Optional from .exc import SendLimitError, InvalidClientObject class Send: def __init__(self, address: str, cryptocurrency: str, amount: float): self.address = address self.cryptocurr...
from .gcore.queries import GetNetworkFee, GetBalance from .gcore.mutations import SendCoin from typing import List, Optional from .exc import SendLimitError, InvalidClientObject class Send: def __init__(self, address: str, cryptocurrency: str, amount: float): self.address = address self.cryptocurr...
none
1
2.350477
2
snippet/example/python/url.py
yp2800/snippet
94
8565
<gh_stars>10-100 # -*- coding: utf-8 -*- try: from urlparse import urlparse, urlunsplit except ImportError: from urllib.parse import urlparse, urlunsplit class URL(object): DEFAULT_SCHEME = ["http", "https"] def __init__(self, url, allowed_scheme=None): self._url = url self.url = url...
# -*- coding: utf-8 -*- try: from urlparse import urlparse, urlunsplit except ImportError: from urllib.parse import urlparse, urlunsplit class URL(object): DEFAULT_SCHEME = ["http", "https"] def __init__(self, url, allowed_scheme=None): self._url = url self.url = urlparse(self._url) ...
en
0.769321
# -*- coding: utf-8 -*-
2.976561
3
netvisor_api_client/services/dimension.py
tristen-tooming/netvisor-api-client
0
8566
from .base import Service from ..requests.dimension import CreateDimensionsRequest, DimensionsListRequest class DimensionService(Service): def create(self, data): request = CreateDimensionsRequest( self.client, params={'method': 'add'}, data=data ) retu...
from .base import Service from ..requests.dimension import CreateDimensionsRequest, DimensionsListRequest class DimensionService(Service): def create(self, data): request = CreateDimensionsRequest( self.client, params={'method': 'add'}, data=data ) retu...
none
1
2.619974
3
cishouseholds/filter.py
ONS-SST/cis_households
0
8567
<gh_stars>0 from typing import List from typing import Union from pyspark.sql import DataFrame from pyspark.sql import functions as F from pyspark.sql.window import Window def filter_all_not_null(df: DataFrame, reference_columns: List[str]) -> DataFrame: """ Filter rows which have NULL values in all the spec...
from typing import List from typing import Union from pyspark.sql import DataFrame from pyspark.sql import functions as F from pyspark.sql.window import Window def filter_all_not_null(df: DataFrame, reference_columns: List[str]) -> DataFrame: """ Filter rows which have NULL values in all the specified column...
en
0.709229
Filter rows which have NULL values in all the specified columns. From households_aggregate_processes.xlsx, filter number 2. Parameters ---------- df reference_columns Columns to check for missing values in, all must be missing for the record to be dropped. Drop duplicates based on tw...
3.358688
3
cscs-checks/cuda/multi_gpu.py
hpc-unibe-ch/reframe
0
8568
<reponame>hpc-unibe-ch/reframe<gh_stars>0 # Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import os import reframe.utility.sanity as sn import reframe as rfm @rfm.required...
# Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import os import reframe.utility.sanity as sn import reframe as rfm @rfm.required_version('>=2.16-dev0') @rfm.simple_test c...
en
0.754266
# Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause # Set nvcc flags # Perform a single bandwidth test with a buffer size of 1024MB # perf_patterns and reference will be set by th...
1.801777
2
sympy/series/tests/test_demidovich.py
msgoff/sympy
0
8569
from sympy import ( limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S, ) # Numbers listed with the tests refer to problem numbers in the book # "Anti-demidovich, problemas resueltos, Ed. URSS" x = Symbol("x") def test_...
from sympy import ( limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S, ) # Numbers listed with the tests refer to problem numbers in the book # "Anti-demidovich, problemas resueltos, Ed. URSS" x = Symbol("x") def test_...
en
0.379135
# Numbers listed with the tests refer to problem numbers in the book # "Anti-demidovich, problemas resueltos, Ed. URSS" # 175 # 172 # 179 # Primjer 1 # Primjer 2 # 181 # 182 # 183 # 184 # 186 # 187 # 188 # 189 # 190 # issue 3513 # 196 # 197 # 198 # Primer 4 # 199 # 200 # 201 # 202 # Primer 5 # 205 # 207 # 213 # 214 # i...
3.17227
3
notion/ctx.py
jfhbrook/notion-tools
1
8570
from notion.client import NotionClient from notion.settings import Settings class Context: def __init__(self): self.settings = Settings.from_file() self._client = None def get_client(self): if not self._client: self.settings.validate() self._client = NotionClie...
from notion.client import NotionClient from notion.settings import Settings class Context: def __init__(self): self.settings = Settings.from_file() self._client = None def get_client(self): if not self._client: self.settings.validate() self._client = NotionClie...
none
1
2.172992
2
setup.py
rgooler/bootstrap-pip
0
8571
<filename>setup.py #!/usr/bin/env python import os try: from setuptools import setup except ImportError: from distutils.core import setup def read(*paths): """Build a file path from *paths* and return the contents.""" with open(os.path.join(*paths), 'r') as f: return f.read() install_require...
<filename>setup.py #!/usr/bin/env python import os try: from setuptools import setup except ImportError: from distutils.core import setup def read(*paths): """Build a file path from *paths* and return the contents.""" with open(os.path.join(*paths), 'r') as f: return f.read() install_require...
en
0.497599
#!/usr/bin/env python Build a file path from *paths* and return the contents. # install_requires = ['requests >= 2.1.0'] # For SNI support in Python 2, must install the following packages # if sys.version_info[0] == 2: # install_requires.append('pyOpenSSL >= 0.14') # install_requires.append('ndg-httpsclient >= ...
2.126928
2
cfdata/tabular/converters/__init__.py
carefree0910/carefree-data
9
8572
from .base import * from .string import * from .categorical import * from .numerical import * __all__ = ["Converter", "converter_dict"]
from .base import * from .string import * from .categorical import * from .numerical import * __all__ = ["Converter", "converter_dict"]
none
1
1.075889
1
hello_world.py
BronWang/first_github
0
8573
def hello_world(): """打印Hello world""" message = 'hello world' print(message.title()) hello_world()
def hello_world(): """打印Hello world""" message = 'hello world' print(message.title()) hello_world()
zh
0.20271
打印Hello world
2.750768
3
Python/Samples/Observer/UtObserver.py
plasroom46/DesignPattern.Sample
9
8574
import unittest from Observers import Observer, ObserverMailServer, ObserverPbx from Subjects import Subject, SubjectEflow class UtVisitor(unittest.TestCase): def test_observer(self): # Create observers pbx = ObserverPbx() ms = ObserverMailServer() # Create subject ...
import unittest from Observers import Observer, ObserverMailServer, ObserverPbx from Subjects import Subject, SubjectEflow class UtVisitor(unittest.TestCase): def test_observer(self): # Create observers pbx = ObserverPbx() ms = ObserverMailServer() # Create subject ...
en
0.831654
# Create observers # Create subject # Notify when JB is leave of absence
3.040535
3
modules/voxelman/config.py
Relintai/pandemonium_engine
0
8575
def can_build(env, platform): return True def configure(env): pass def get_doc_classes(): return [ "WorldArea", "VoxelLight", "VoxelLightNode", "VoxelLevelGenerator", "VoxelLevelGeneratorFlat", "VoxelSurfaceMerger", "VoxelSurfaceSimple", ...
def can_build(env, platform): return True def configure(env): pass def get_doc_classes(): return [ "WorldArea", "VoxelLight", "VoxelLightNode", "VoxelLevelGenerator", "VoxelLevelGeneratorFlat", "VoxelSurfaceMerger", "VoxelSurfaceSimple", ...
none
1
1.747734
2
Python/2021/day_04/day_04.py
JonoRicci/Advent-Of-Code
0
8576
<gh_stars>0 """ Day 04 """ from logger import logger def main() -> None: """ Import the puzzle input, process and display the results. """ puzzle_input = import_list() logger.debug(puzzle_input) final_score = play_bingo(puzzle_input) for result in final_score: logger.info(f"The f...
""" Day 04 """ from logger import logger def main() -> None: """ Import the puzzle input, process and display the results. """ puzzle_input = import_list() logger.debug(puzzle_input) final_score = play_bingo(puzzle_input) for result in final_score: logger.info(f"The final score i...
en
0.845976
Day 04 Import the puzzle input, process and display the results. Import the puzzle input and return a list. :return: Puzzle input text file as list :rtype: list Extract winning numbers, bingo boards from input. Make a separate 2D list tracking wins. For each winning number, check every board row and co...
3.851394
4
timeeval_experiments/algorithms/eif.py
HPI-Information-Systems/TimeEval
2
8577
from durations import Duration from typing import Any, Dict, Optional from timeeval import Algorithm, TrainingType, InputDimensionality from timeeval.adapters import DockerAdapter from timeeval.params import ParameterConfig _eif_parameters: Dict[str, Dict[str, Any]] = { "extension_level": { "defaultValue": None, ...
from durations import Duration from typing import Any, Dict, Optional from timeeval import Algorithm, TrainingType, InputDimensionality from timeeval.adapters import DockerAdapter from timeeval.params import ParameterConfig _eif_parameters: Dict[str, Dict[str, Any]] = { "extension_level": { "defaultValue": None, ...
none
1
2.235755
2
deepchem/models/tf_new_models/graph_models.py
KEHANG/deepchem
0
8578
""" Convenience classes for assembling graph models. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals __author__ = "<NAME> and <NAME>" __copyright__ = "Copyright 2016, Stanford University" __license__ = "MIT" import tensorflow as tf from deepchem.nn.lay...
""" Convenience classes for assembling graph models. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals __author__ = "<NAME> and <NAME>" __copyright__ = "Copyright 2016, Stanford University" __license__ = "MIT" import tensorflow as tf from deepchem.nn.lay...
en
0.565884
Convenience classes for assembling graph models. An analog of Keras Sequential class for Graph data. Like the Sequential class from Keras, but automatically passes topology placeholders from GraphTopology to each graph layer (from layers) added to the network. Non graph layers don't get the extra placeholders. P...
3.055378
3
questionbank/users/urls.py
SyafiqTermizi/questionbank
1
8579
<filename>questionbank/users/urls.py from django.urls import path from .views import ( UserListView, UserUpdateView, UserProfileView, UserDeleteView, AcceptInvitationView, SpecialtyListView, SpecialtyCreateView, SpecialtyUpdateView, SpecialtyDeleteView ) app_name = 'users' urlpatterns = [ path('', Us...
<filename>questionbank/users/urls.py from django.urls import path from .views import ( UserListView, UserUpdateView, UserProfileView, UserDeleteView, AcceptInvitationView, SpecialtyListView, SpecialtyCreateView, SpecialtyUpdateView, SpecialtyDeleteView ) app_name = 'users' urlpatterns = [ path('', Us...
none
1
2.063076
2
qiskit_machine_learning/algorithms/regressors/neural_network_regressor.py
Zoufalc/qiskit-machine-learning
1
8580
<reponame>Zoufalc/qiskit-machine-learning<filename>qiskit_machine_learning/algorithms/regressors/neural_network_regressor.py # This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the ...
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
en
0.796665
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
3.411709
3
residuals.py
fbob/mplFOAM
8
8581
<gh_stars>1-10 #!/usr/bin/env python # encoding: utf-8 import sys import getopt import re import os import pylab as plt import numpy as np # Define the variables for which the residuals will be plotted variables = ["Ux", "Uy", "T", "p_rgh", "k", "epsilon"] # Get the arguments of the script def usage(): print("Us...
#!/usr/bin/env python # encoding: utf-8 import sys import getopt import re import os import pylab as plt import numpy as np # Define the variables for which the residuals will be plotted variables = ["Ux", "Uy", "T", "p_rgh", "k", "epsilon"] # Get the arguments of the script def usage(): print("Usage: residuals....
en
0.663672
#!/usr/bin/env python # encoding: utf-8 # Define the variables for which the residuals will be plotted # Get the arguments of the script # Get the lines of the logfile 'log_file' # Get the time and continuity values # Time(s) or iterations counter # Continuity values # Search for string 'Time' at the begining of the li...
3.041201
3
content_generator/vitae.py
empiricalstateofmind/personal_website
0
8582
<reponame>empiricalstateofmind/personal_website # Generate the vitae.json file used to populate the Vitae section of the website. import pandas as pd import re from datetime import datetime from collections import defaultdict import json # Publications def create_publications(filepath): publications...
# Generate the vitae.json file used to populate the Vitae section of the website. import pandas as pd import re from datetime import datetime from collections import defaultdict import json # Publications def create_publications(filepath): publications = pd.read_excel(filepath, sheet_name='publicati...
en
0.833035
# Generate the vitae.json file used to populate the Vitae section of the website. # Publications # FILEPATH = "D:/Dropbox/projects/personal_cv/vitae.xlsx" # We can pass this as an argument later
2.845157
3
cement/ext/ext_generate.py
tomekr/cement
826
8583
""" Cement generate extension module. """ import re import os import inspect import yaml import shutil from .. import Controller, minimal_logger, shell from ..utils.version import VERSION, get_version LOG = minimal_logger(__name__) class GenerateTemplateAbstractBase(Controller): class Meta: pass de...
""" Cement generate extension module. """ import re import os import inspect import yaml import shutil from .. import Controller, minimal_logger, shell from ..utils.version import VERSION, get_version LOG = minimal_logger(__name__) class GenerateTemplateAbstractBase(Controller): class Meta: pass de...
en
0.286571
Cement generate extension module. # builtin vars # default ignore the .generate.yml config # pragma: nocover # pragma: nocover # pragma: nocover # look in app template dirs # use app template module, find it's path on filesystem # FIXME: not exactly sure how to test for this so not covering # pragma: nocover # pragma: ...
2.297929
2
ditto/core/__init__.py
Kvoti/ditto
0
8584
from . import forms from . import views ADMIN_ROLE = "Administrator" MEMBER_ROLE = "Member" GUEST_ROLE = "Guest" DEFAULT_ROLES = [ADMIN_ROLE, MEMBER_ROLE, GUEST_ROLE]
from . import forms from . import views ADMIN_ROLE = "Administrator" MEMBER_ROLE = "Member" GUEST_ROLE = "Guest" DEFAULT_ROLES = [ADMIN_ROLE, MEMBER_ROLE, GUEST_ROLE]
none
1
1.279923
1
training_stats/hrm.py
salwator/training_stats
4
8585
from .gpxfile import get_hr_measurements from .utils import interpolate from operator import itemgetter def __calculate_moving_sums(points, window): """ Calculates hr moving sums of the window len """ time, hrs = zip(*points) moving_sum = sum(hrs[0:window]) sums = [(time[0], moving_sum)] for i, t ...
from .gpxfile import get_hr_measurements from .utils import interpolate from operator import itemgetter def __calculate_moving_sums(points, window): """ Calculates hr moving sums of the window len """ time, hrs = zip(*points) moving_sum = sum(hrs[0:window]) sums = [(time[0], moving_sum)] for i, t ...
en
0.833944
Calculates hr moving sums of the window len Given list of (time, hr), returns lactate threshold and selected data # test time # measured period in seconds # your lactate threshold is average of last 20 in 30 minutes of tempo run
3.121937
3
scripts/utils/import_languages.py
mozilla-releng/staging-mozilla-vpn-client
0
8586
#! /usr/bin/env python3 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import argparse import xml.etree.ElementTree as ET import os import sys import shutil import ate...
#! /usr/bin/env python3 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import argparse import xml.etree.ElementTree as ET import os import sys import shutil import ate...
en
0.662579
#! /usr/bin/env python3 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Use the project root as the working directory # Include only locales above this threshold (e.g....
2.087829
2
cogs/filter.py
Velgaster/Discord-User-Vote
0
8587
from discord.ext import commands import discord def setup(client): client.add_cog(KeyWordFilter(client)) class KeyWordFilter(commands.Cog): def __init__(self, client): self.client = client self.log_ch = self.client.get_channel(int(self.client.SETTINGS.LOG_CHANNEL)) @commands.Cog.listene...
from discord.ext import commands import discord def setup(client): client.add_cog(KeyWordFilter(client)) class KeyWordFilter(commands.Cog): def __init__(self, client): self.client = client self.log_ch = self.client.get_channel(int(self.client.SETTINGS.LOG_CHANNEL)) @commands.Cog.listene...
none
1
2.389588
2
api/app.py
sai-krishna-msk/KickAssist
0
8588
<gh_stars>0 from ml_model.model import KickModel import numpy as np import pandas as pd import eli5 import joblib import flask from flask import Flask, render_template, request, jsonify app = Flask(__name__) model_oh = joblib.load('ml_model/estimators/model_oh.sav') model_hel = joblib.load('ml_model/estimators/model...
from ml_model.model import KickModel import numpy as np import pandas as pd import eli5 import joblib import flask from flask import Flask, render_template, request, jsonify app = Flask(__name__) model_oh = joblib.load('ml_model/estimators/model_oh.sav') model_hel = joblib.load('ml_model/estimators/model_hel.sav') e...
none
1
2.687813
3
snowddl/resolver/primary_key.py
littleK0i/SnowDDL
21
8589
<reponame>littleK0i/SnowDDL from snowddl.blueprint import PrimaryKeyBlueprint from snowddl.resolver.abc_schema_object_resolver import AbstractSchemaObjectResolver, ResolveResult, ObjectType class PrimaryKeyResolver(AbstractSchemaObjectResolver): def get_object_type(self) -> ObjectType: return ObjectType.P...
from snowddl.blueprint import PrimaryKeyBlueprint from snowddl.resolver.abc_schema_object_resolver import AbstractSchemaObjectResolver, ResolveResult, ObjectType class PrimaryKeyResolver(AbstractSchemaObjectResolver): def get_object_type(self) -> ObjectType: return ObjectType.PRIMARY_KEY def get_exis...
none
1
2.32121
2
modules/module0/02_datastructures_and_geometry/datastructures_2b.py
tetov/ITA19
7
8590
import os import compas from compas.datastructures import Mesh from compas_rhino.artists import MeshArtist HERE = os.path.dirname(__file__) DATA = os.path.join(HERE, 'data') FILE = os.path.join(DATA, 'faces.obj') mesh = Mesh.from_obj(FILE) artist = MeshArtist(mesh, layer="Mesh") artist.draw_vertices( color={ke...
import os import compas from compas.datastructures import Mesh from compas_rhino.artists import MeshArtist HERE = os.path.dirname(__file__) DATA = os.path.join(HERE, 'data') FILE = os.path.join(DATA, 'faces.obj') mesh = Mesh.from_obj(FILE) artist = MeshArtist(mesh, layer="Mesh") artist.draw_vertices( color={ke...
none
1
2.585056
3
OOP/Exercises/First_steps_in_OOP_Exercises/8_pokemon/project/pokemon.py
tankishev/Python
2
8591
<reponame>tankishev/Python<filename>OOP/Exercises/First_steps_in_OOP_Exercises/8_pokemon/project/pokemon.py<gh_stars>1-10 # The Pokemon class should receive a name (string) and health (int) upon initialization. # It should also have a method called pokemon_details that returns the information about the pokemon: # "{pok...
# The Pokemon class should receive a name (string) and health (int) upon initialization. # It should also have a method called pokemon_details that returns the information about the pokemon: # "{pokemon_name} with health {pokemon_health}" class Pokemon: def __init__(self, name: str, health: int) -> None: ...
en
0.927727
# The Pokemon class should receive a name (string) and health (int) upon initialization. # It should also have a method called pokemon_details that returns the information about the pokemon: # "{pokemon_name} with health {pokemon_health}"
3.724721
4
tests/test_pandas.py
ONSdigital/ons_utils
0
8592
"""Tests for the pandas helpers in the pd_helpers.py module.""" import pytest from pandas.testing import assert_frame_equal from tests.conftest import create_dataframe from ons_utils.pandas import * def test_nested_dict_to_df(): """Test for nested_dict_to_df.""" input_d = { 'bones': { 'f...
"""Tests for the pandas helpers in the pd_helpers.py module.""" import pytest from pandas.testing import assert_frame_equal from tests.conftest import create_dataframe from ons_utils.pandas import * def test_nested_dict_to_df(): """Test for nested_dict_to_df.""" input_d = { 'bones': { 'f...
en
0.774217
Tests for the pandas helpers in the pd_helpers.py module. Test for nested_dict_to_df. # Sort values as dict order not preserved. # Set index because function returns a MultiIndex. Group of tests for Stacker. Test for Stacker. Test for this. Group of tests for MultiIndexSlicer. Test for MultiIndexSlicer. Test for this. ...
2.988523
3
lsf_ibutils/ibsub/__init__.py
seanfisk/lsf-ibutils
0
8593
<filename>lsf_ibutils/ibsub/__init__.py """:mod:`lsf_ibutils.ibsub` -- Interactive batch submission utility """
<filename>lsf_ibutils/ibsub/__init__.py """:mod:`lsf_ibutils.ibsub` -- Interactive batch submission utility """
en
0.550865
:mod:`lsf_ibutils.ibsub` -- Interactive batch submission utility
1.08001
1
build/lib/configger/fishes/__init__.py
PaperDevil/pyconfigger
2
8594
<reponame>PaperDevil/pyconfigger<gh_stars>1-10 import os splited_path = os.path.realpath(__file__).split('\\')[:-1] fish_path = '\\'.join(splited_path) fish_json_name = "fish.json" fish_json_path = os.path.join(fish_path, fish_json_name)
import os splited_path = os.path.realpath(__file__).split('\\')[:-1] fish_path = '\\'.join(splited_path) fish_json_name = "fish.json" fish_json_path = os.path.join(fish_path, fish_json_name)
none
1
2.107305
2
setup.py
IntuitionEngineeringTeam/RedBlackPy
12
8595
# # Created by <NAME>. # Copyright 2018 Intuition. All rights reserved. # import os import platform from setuptools import setup from setuptools.command.build_ext import build_ext from distutils.extension import Extension from Cython.Build import cythonize from rbp_setup_tools.code_generation import generate_from_cy...
# # Created by <NAME>. # Copyright 2018 Intuition. All rights reserved. # import os import platform from setuptools import setup from setuptools.command.build_ext import build_ext from distutils.extension import Extension from Cython.Build import cythonize from rbp_setup_tools.code_generation import generate_from_cy...
en
0.248138
# # Created by <NAME>. # Copyright 2018 Intuition. All rights reserved. # #-------------------------------------------------------------------------------------------- # Generate cython code for all supporting types #-------------------------------------------------------------------------------------------- #-------...
1.782742
2
source/accounts/views.py
kishan2064/hashpy1
0
8596
from django.contrib.auth import login, authenticate, REDIRECT_FIELD_NAME, get_user_model from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.views import PasswordResetView as BasePasswordResetView, SuccessURLAllowedHostsMixin from django.shortcuts impor...
from django.contrib.auth import login, authenticate, REDIRECT_FIELD_NAME, get_user_model from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.views import PasswordResetView as BasePasswordResetView, SuccessURLAllowedHostsMixin from django.shortcuts impor...
en
0.917576
# Sets a test cookie to make sure the user has cookies enabled # If the test cookie worked, go ahead and # delete it since its no longer needed # Set temporary username # Change the username to "user_ID" form # Activate user's profile # Remove activation record, it is unneeded # Change user's email # Remove activation ...
1.855584
2
conversationkg/kgs/writers.py
INDElab/conversationkg
3
8597
<reponame>INDElab/conversationkg<gh_stars>1-10 from ..conversations.corpus import Conversation from ..conversations.emails import Email from collections import Counter import matplotlib import pandas as pd import json class JSONWriter: def __init__(self, kg): self.kg = kg self.entities = kg.en...
from ..conversations.corpus import Conversation from ..conversations.emails import Email from collections import Counter import matplotlib import pandas as pd import json class JSONWriter: def __init__(self, kg): self.kg = kg self.entities = kg.entities() self.triples = kg.triples ...
en
0.117977
# hash(e) # hash((s, p, o)) # s.time.timestamp() # hash(s) # hash(o) MATCH (x) DETACH DELETE x
2.450925
2
model-test.py
shikew/Handwriting-calculator
0
8598
import numpy as np from PIL import Image from keras.models import load_model img_gray = Image.open('1002.png') number = np.array(img_gray) print(number.shape) print('准备的图片的shape:',number.flatten().shape) print('原number:',number) number = number.astype('float32') number = number/255 #归一化 number = number.flatten() pri...
import numpy as np from PIL import Image from keras.models import load_model img_gray = Image.open('1002.png') number = np.array(img_gray) print(number.shape) print('准备的图片的shape:',number.flatten().shape) print('原number:',number) number = number.astype('float32') number = number/255 #归一化 number = number.flatten() pri...
ja
0.124041
#归一化 # model.load_weights('mnist.model.best.hdf5') # def recognize(photo_data): # return clf.predict(photo_data) #print('测试标签为:',test_target[8000])
3.317003
3
deps/libgdal/gyp-formats/ogr_mem.gyp
khrushjing/node-gdal-async
42
8599
<gh_stars>10-100 { "includes": [ "../common.gypi" ], "targets": [ { "target_name": "libgdal_ogr_mem_frmt", "type": "static_library", "sources": [ "../gdal/ogr/ogrsf_frmts/mem/ogrmemdatasource.cpp", "../gdal/ogr/ogrsf_frmts/mem/ogrmemlayer.cpp", "../gdal/ogr/ogrsf_frmts/mem/ogrmemdriver.cpp" ...
{ "includes": [ "../common.gypi" ], "targets": [ { "target_name": "libgdal_ogr_mem_frmt", "type": "static_library", "sources": [ "../gdal/ogr/ogrsf_frmts/mem/ogrmemdatasource.cpp", "../gdal/ogr/ogrsf_frmts/mem/ogrmemlayer.cpp", "../gdal/ogr/ogrsf_frmts/mem/ogrmemdriver.cpp" ], "include...
none
1
0.936372
1